Get Metadata from Image using Java REST API

This short tutorial shows how to ImagingApi and GetimageProperties to retrieve metadata from a JPEG image using the Java REST API. You will also learn to extract Exif data and view properties for other formats such as PNG.

Prerequisite

Steps for Extracting Metadata from Images using Java REST Interface

  1. Create the ImagingApi class object by setting the client secret, ID, base URL, and API version.
  2. Select the input image, read it into a memory stream, and upload it to the Cloud storage.
  3. Create an image properties request using the GetImagePropertiesRequest() method.
  4. Get the image properties using the GetImageProperties() method.
  5. Parse the response from the API and display all the properties.

These steps describe how to check metadata of a photo using the Java‑based API. Create the ImagingApi class object using the client secret and ID, read the image into the memory stream, upload it to the Cloud storage, and create a request to get properties of an image using the GetImagePropertiesRequest() method. Call the GetImageProperties() method by passing the request object and retrieve the properties from the API response.

Code to View Picture Metadata using Java RESTful Service

The sample demonstrates how to fetch image metadata using the Java Low Code API. If the loaded image is a JPEG, the JpegExifData provides additional properties for that format. Depending on the image type, the corresponding property classes—such as JpegProperties, PngProperties, GifProperties, etc.—are populated and can be used to identify the image type.

This article has taught the process to retrieve image properties. To convert TIFF to JPG, refer to the article Convert TIFF to JPG using Java REST API.

Keywords: image metadata using Java Low Code API; get metadata from image using Java REST API; check image meta data using Java RESTful Service; check metadata of photo using Java-based API; get picture metadata using Java Low Code API.