Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a javascript mechanism to modify EXIF metadata information of Image? [closed]

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.

like image 755
Dinesh Babu Avatar asked Nov 29 '13 06:11

Dinesh Babu


People also ask

Can EXIF metadata be modified?

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.

Is EXIF data editable?

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.

Can the metadata of a picture be altered?

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.


1 Answers

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/

  • 1 = The 0th row is at the visual top of the image, and the 0th column is the visual left-hand side.
  • 2 = The 0th row is at the visual top of the image, and the 0th column is the visual right-hand side.
  • 3 = The 0th row is at the visual bottom of the image, and the 0th column is the visual right-hand side.
  • 4 = The 0th row is at the visual bottom of the image, and the 0th column is the visual left-hand side.
  • 5 = The 0th row is the visual left-hand side of the image, and the 0th column is the visual top.
  • 6 = The 0th row is the visual right-hand side of the image, and the 0th column is the visual top.
  • 7 = The 0th row is the visual right-hand side of the image, and the 0th column is the visual bottom.
  • 8 = The 0th row is the visual left-hand side of the image, and the 0th column is the visual bottom.
like image 105
display name Avatar answered Nov 08 '22 10:11

display name