Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
174
rated 0 times [  175] [ 1]  / answers: 1 / hits: 27135  / 12 Years ago, thu, april 26, 2012, 12:00:00

I am trying to extract EXIF data from a image(jpeg) which has been dragged into the browser or has been selected via a html file input element.



I managed to preview the image within the browser using FileReader and FileReader.readAsDataURL
as described here.



and I found a EXIF library which allows to extract the EXIF data of an image via javascript. But for me it only works if I use it with normal img tags which load their content over a URL.



I also found this question on StackOverflow where the accepted answer states that it is just not possible.



But I am pretty sure that it can be realized because 500px.com extracts the EXIF data immediately after a file is added for upload and before the upload has been finished.



Some ideas how it should be possible to extract the EXIF data from the base64 encoded image I get from the FileReader?


More From » jquery

 Answers
54

I finally found a client side solution for the problem:




  1. Read the file using the FileReader and the method .readAsBinaryString

  2. Then wrap that binary string into a BinaryFile object which is already included in the EXIF Library

  3. Finally call EXIF.readFromBinaryFile(binaryFileObject);



and its done :)


[#85943] Wednesday, April 25, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
kristinsonjab

Total Points: 364
Total Questions: 98
Total Answers: 98

Location: Christmas Island
Member since Mon, Oct 19, 2020
4 Years ago
kristinsonjab questions
Fri, Mar 4, 22, 00:00, 2 Years ago
Fri, Jan 22, 21, 00:00, 3 Years ago
Fri, Aug 14, 20, 00:00, 4 Years ago
;