Javascript 从图像中提取 exif 方向数据
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14270574/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
extract exif orientation data from image
提问by jujule
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.
我需要使用 Javascript 从 HTML JPEG 图像中提取方向 EXIF 数据。
according to exiftool's documentationthe orientation flag is found at offset 0x112 within the EXIF marker, and occupies 2 bytes.
根据exiftool 的文档,方向标志位于 EXIF 标记内的偏移量 0x112 处,占用 2 个字节。
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.
我想我们只需要以良好的偏移量提取数据并“转换”该值,但我不知道如何在浏览器中实现这一点。结果值应该是 1 到 8 之间的数字,用于描述方向。
How to read that data from a simple IMG tag ? I need a webkit only solution, but browser only.
如何从简单的 IMG 标签中读取数据?我只需要一个 webkit 解决方案,但只需要浏览器。
Thanks !
谢谢 !

