Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
87
rated 0 times [  93] [ 6]  / answers: 1 / hits: 35433  / 12 Years ago, fri, january 11, 2013, 12:00:00

Possible Duplicate:

Accessing JPEG EXIF rotation data in Javascript on the client side






I'd need to extract the orientation EXIF data from an HTML JPEG image with Javascript.



according to exiftool's documentation the orientation flag is found at offset 0x112 within the EXIF marker, and occupies 2 bytes.



I guess we just need to extract the data at good offset and 'convert' the value but i don't have any idea how to achieve this in the browser. The result value should be a number between 1 and 8 describing the orientation.



How to read that data from a simple IMG tag ?
I need a webkit only solution, but browser only.



Thanks !


More From » html

 Answers
5

Possible duplicate of this question.



thanks. here's the final code example to get orientation :



var b64 = data:image/jpeg;base64,/9j/4AAQSkZJRgABA......;
var bin = atob(b64.split(',')[1]);
var exif = EXIF.readFromBinaryFile(new BinaryFile(bin));
alert(exif.Orientation);

[#80952] Wednesday, January 9, 2013, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
bryonk

Total Points: 161
Total Questions: 116
Total Answers: 107

Location: Albania
Member since Sun, Nov 22, 2020
4 Years ago
bryonk questions
;