读取 EXIF 并确定闪光灯是否已闪光
我一直在用 PHP 脚本读取一些 EXIF 数据。我想确定某个图像是否使用了闪光灯。以下是 EXIF 读取器返回的值,
0x0 = No Flash
0x1 = Fired
0x5 = Fired, Return not detected
0x7 = Fired, Return detected
0x8 = On, Did not fire
0x9 = On, Fired
0xd = On, Return not detected
0xf = On, Return detected
0x10 = Off, Did not fire
0x14 = Off, Did not fire, Return not detected
0x18 = Auto, Did not fire
0x19 = Auto, Fired
0x1d = Auto, Fired, Return not detected
0x1f = Auto, Fired, Return detected
0x20 = No flash function
0x30 = Off, No flash function
0x41 = Fired, Red-eye reduction
0x45 = Fired, Red-eye reduction, Return not detected
0x47 = Fired, Red-eye reduction, Return detected
0x49 = On, Red-eye reduction
0x4d = On, Red-eye reduction, Return not detected
0x4f = On, Red-eye reduction, Return detected
0x50 = Off, Red-eye reduction
0x58 = Auto, Did not fire, Red-eye reduction
0x59 = Auto, Fired, Red-eye reduction
0x5d = Auto, Fired, Red-eye reduction, Return not detected
0x5f = Auto, Fired, Red-eye reduction, Return detected
其中哪些值表示 Flash 已被使用?
此致, 姆拉乔
I have been reading some EXIF data with my PHP script. I want to determine for a certain image if the flash has been used. Here are the values returned by EXIF reader
0x0 = No Flash
0x1 = Fired
0x5 = Fired, Return not detected
0x7 = Fired, Return detected
0x8 = On, Did not fire
0x9 = On, Fired
0xd = On, Return not detected
0xf = On, Return detected
0x10 = Off, Did not fire
0x14 = Off, Did not fire, Return not detected
0x18 = Auto, Did not fire
0x19 = Auto, Fired
0x1d = Auto, Fired, Return not detected
0x1f = Auto, Fired, Return detected
0x20 = No flash function
0x30 = Off, No flash function
0x41 = Fired, Red-eye reduction
0x45 = Fired, Red-eye reduction, Return not detected
0x47 = Fired, Red-eye reduction, Return detected
0x49 = On, Red-eye reduction
0x4d = On, Red-eye reduction, Return not detected
0x4f = On, Red-eye reduction, Return detected
0x50 = Off, Red-eye reduction
0x58 = Auto, Did not fire, Red-eye reduction
0x59 = Auto, Fired, Red-eye reduction
0x5d = Auto, Fired, Red-eye reduction, Return not detected
0x5f = Auto, Fired, Red-eye reduction, Return detected
Which of them mean that the flash has been used?
Best regards,
Mladjo
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
flash 属性实际上是以下标志的组合:
要检查 flash 是否已闪光,请将 flash 属性与
1
按位与:The flash property is actually a combination of the following flags:
To check if the flash has fired, bitwise AND the flash property with
1
:我相信,如果将十六进制值转换为二进制,最右边的数字将指示闪光灯是否实际闪光。
因此:
I believe if you convert the hex value to binary, the right-most digit then indicates if the flash actually fired or not.
Therefore:
为了简化问题,您可以遵循以下原则:奇数值表示闪光灯已闪光,偶数值(包括零)表示闪光灯未闪光。
您可以在 Tiff 标签参考中获取更多信息和每个值的含义。
To simplify things, you can follow this: odd value means flash fired and even value (including zero) means flash did not fire.
You can get more information and meaning of each value at Tiff Tag Reference.
为什么要检查大量列表?对于照片文件,通常只对发生的事件感兴趣,而不是相机的前一个(可能不活动)开关位置!因此,只需进行一些二进制比较即可查询有效的闪光事件(请参见下面的代码片段)。玩得开心!
Why checking huge listings? With photo files, normally only occurrence is of interest, not the former (possibly inactive) switch position of the camera! The effective flash event can therefore be queried with just a few binary comparisons (see code snippet below). Have fun!