Your images can contain hidden data such as location, the model of the camera you used, ISO and other camera settings, size, comments and more. In a past article, we have already explained how to find out about metadata in your files. But today, we will go a step further:
Find out how to actually edit and change certain information of your file!
Change Hidden Data In Your Images
Some information about your photos and pictures cannot be changed. But some exif data can actually be manipulated in order to not reveal certain information about the image, where it was taken, with which equipment and when.
This article will explain how you can do so using the RESTful API of online-convert.com and Postman.
Helpful links:
1. Extract Exif Information
First, you have to find out which information is contained in your image and which of these values can be edited and manipulated. To do so, you have to send the following POST command:
{ "input":[{ "type":"remote", "source":"http://static.online-convert.com/example-file/raster%20image/png/example.png" }], "conversion":[{ "category": "metadata", "target": "json", "options": { "keys_format": "snake_lowercase", "output_mode": "expert" } }] }
This command contains extra options that add to the simple call to get metadata from an image. This includes the key format and the output mode. These two will format the JSON file you will receive as a result in a way that will show you which meta information is editable.
After sending a GET for the conversion result, you can download the JSON that contains ordered information. The information in block “1” can contain metadata values that can be changed. Consider the following screenshots of the JSON we received after sending the command above:
Metadata that is open for modification is labeled by “editable:” true. Searching for this string inside the document will provide you with a list of information you can change.
2. Create Call To Change Metadata
With this list of editable metadata keys from above, you can now construct a new POST command that will change them.
As an example, we want to change the following value:
"Gamma": { "editable": true, "key_formatted": "gamma", "value": 2.2 }
This can be done by adding the value to a call that will let the API know to target the metadata of a file. Consider the following code:
{ "input":[{ "type":"remote", "source":"https://static.online-convert.com/example-file/raster%20image/png/example.png" }], "conversion":[{ "target": "metadata", "metadata": { "mode": "expert", "1": { "Gamma": { "editable": true, "key_formatted": "gamma", "value": 5 } } } }] }
The target of the conversion is not the file format, but metadata which will let the API know that it has to change the exif data of the image. Under value for the meta key, you can add what you want the metadata to be changed to.
Now, you can send the command and also send a GET to receive the conversion result.
3. Check The New File’s Exif
All that’s left to do is to double-check whether the meta information was successfully changed. For this, we send the new file to check for metadata again and check the resulting, new JSON.
As we can see, the meta information of the converted image file contains a value for the Gamma information of 5, exactly the value we set.
Follow us