This short tutorial guides on how to get metadata from image using C# REST API. You will learn to get picture metadata using C# Low Code API with the help of a .NET-based Cloud SDK. Details will also be provided to fetch Exif data for the JPEG images.
Prerequisite
- Create an account API credentials to fetch picture metadata
- Download Aspose.Imaging Cloud SDK for Dotnet for viewing image properties
- Setup C# project with the above SDK
Steps for Extracting Metadata from Images using C# REST Interface
- Create the ImagingApi class object by setting the client secret, 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
- Get the image properties using the GetImageProperties() method
- Parse the response from the API and display all the properties
These steps describe how to check metadata of photo using C# .NET-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 C# RESTful Service
This code demonstrates how to fetch the image metadata using C# Low Code API. If the loaded image is a JPEG image, the JpegExifData provides the additional properties for the JPEG. Note that based on the type of image, the respective properties, such as JpegProperties, PngProperties, GifProperties, etc. are populated and can be used for identifying the image type.
This article has taught us the process to retrieve image properties. To convert TIFF to JPG, refer to the article Convert TIFF to JPG using C# REST API.