J.Do
J.Do

Reputation: 201

Can you get the exif data upon image upload using Javascript?

I have an input file type:

<input type='file' id='upload_files' name='upload_files' file-model='upload_files'/>

I want to be able to extract the exif data if it exists from the uploaded image. Can this be done with javascript/angularjs alone?

I tried using exif_read_data() but it seems that by the time it reaches this point, the exif data has already been lost.

Upvotes: 0

Views: 2998

Answers (1)

J.Do
J.Do

Reputation: 201

Solution:

This is the solution that has worked for me. I used exif-js JavaScript library to extract the exif data from an uploaded image if it exists.

Further Use:

I needed the exif data to get the original orientation of an image. I used the extraction of the exif data and I wrote the data into a file. I saved this file for later use and also use it to extract the Orientation value from the original state of the image. I use this value to appropriate rotate the final image.

Upvotes: 2

Related Questions