How to Remove EXIF Data from an Image using Node.js
The metadata stored by our phones & handheld cameras when we take a photo — otherwise known as “EXIF” data — can sometimes contain a little too much sensitive information (about location, date, time, etc.) to leave on a publicly available image. Our EXIF Removal API will allow you to quickly remove that data from an image entirely, and you can use it for free with a free-tier Cloudmersive API key (you can register for a free account on our website). Below, we’ll walk through how to structure an API call using Node.js.
To begin, let’s install the Node.js SDK by running the below command:
npm install cloudmersive-image-api-client --save
Next, let’s call the function & authenticate the API key:
var CloudmersiveImageApiClient = require('cloudmersive-image-api-client');
var defaultClient = CloudmersiveImageApiClient.ApiClient.instance;// Configure API key authorization: Apikey
var Apikey = defaultClient.authentications['Apikey'];
Apikey.apiKey = 'YOUR API KEY';var apiInstance = new CloudmersiveImageApiClient.EditApi();var imageFile = Buffer.from(fs.readFileSync("C:\\temp\\inputfile").buffer); // File | Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.editRemoveExifData(imageFile, callback);
With that, you’re all done — no more contributions required.