This short tutorial demonstrates how to Node.js REST API can be used to retrieve metadata from an image such as a JPEG or PNG file, leveraging the Aspose.Imaging Cloud SDK for Node.js.
Prerequisite
- Create an account and obtain API credentials to fetch picture metadata
- Download the Aspose.Imaging Cloud SDK for Node.js
- Set up a Node.js project with the above SDK
Steps for Extracting Metadata from Images using Node.js REST Interface
- Create the ImagingApi class object by setting the client secret, client ID, base URL, and API version.
- Select the input image, read it into a memory stream, and upload it to the Cloud storage.
- Create an image properties request using the GetImagePropertiesRequest() method.
- Retrieve the image properties with the GetImageProperties() method.
- Parse the response from the API and display all the properties.
These steps illustrate how to check the metadata of a photo using the Node.js‑based API: instantiate the ImagingApi object, load the image into a memory stream, upload it, build a GetImagePropertiesRequest, call GetImageProperties(), and then read the returned properties.
Code to View Picture Metadata using Node.js RESTful Service
The sample code fetches image metadata via the Node.js Low Code API. When the loaded image is a JPEG, the JpegExifData object provides additional EXIF properties. Depending on the image type, the corresponding property groups—JpegProperties, PngProperties, GifProperties, etc.—are populated and can be used to identify the image format.
This article covered the process of retrieving image properties. To convert TIFF to JPG, see the article Convert TIFF to JPG using Node.js REST API.
Keywords: image metadata using Node.js Low Code API; get metadata from image using Node.js REST API; check image meta data using Node.js RESTful Service; check metadata of photo using Node.js-based API; get picture metadata using Node.js Low Code API.