I am looking for a JavaScript mechanism to modify the image EXIF metadata info, I found plenty of JS libraries that allow me to retrieve EXIF info, but none that modify.
I am looking to modify EXIF orientation information for the image, then save it.
Paid standard programs such as Adobe Lightroom (Mac and Windows), Apple Photos (Mac) and Aperture (Mac) can help you edit the meta information. The free software GIMP now also supports the modification of Exif information. You can access the image metadata simply by opening an image or photo from the Image tab.
EXIFs are created automatically by your digital camera when you take photographs. The information saves within your photo's properties. To edit an EXIF or hide any information you don't want others to access, you'll need a tool that lets you edit and remove image metadata.
Open the image for which you want to check the metadata. Head to the File menu, then click File info. You can also press Ctrl + Alt + Shift + I on Windows and Command + Option + Shift + I on Mac. From here, you can copy or edit the metadata.
blueimp has a library JavaScript-Load-Image that can modify/parse EXIF tag when loading the image. Here is the link to the code on GitHub
use the loadImage()
function and provide the orientation optional field to modify EXIF orientation value.
document.getElementById('file-input').onchange = function (e) {
loadImage(
e.target.files[0],
function (img) {
document.body.appendChild(img);
},
{orientation: 3}
);
};
Here is a list of EXIF orientation values and the specified rotation info available here: https://beradrian.wordpress.com/2008/11/14/rotate-exif-images/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With