iPhone JPG图像具有非标准魔术字节ff d8 ff e1? [英] iPhone JPG image has non-standard magic bytes ff d8 ff e1?
问题描述
我的Web应用程序在接受上传的图像之前,先检查文件扩展名的前四个字节.一位同事向我展示了他iPhone上的图像,这些图像被拒绝了.它们具有不同的第四字节(e1 = 225,而不是预期的e0 = 224).
My web app checks the first four bytes against the file extension before accepting uploaded images. A coworker showed me images from his iPhone which are being rejected. These have a different fourth byte (e1 = 225 instead of the expected e0 = 224).
这在iPhone上很常见吗? JPG文件中还有其他可能使用的魔术字节字符串吗?
Is this usual for iPhones? Are there other possible magic byte strings used in JPG files?
找到了这个有用的列表: http://www.garykessler.net/library/file_sigs.html
found this useful list: http://www.garykessler.net/library/file_sigs.html
推荐答案
它们似乎以某种方式指示JPEG的子类别.我发现,FF D8 FF E0魔术表示"JFIF JPEG",而FF D8 FF E1魔术表示"EXIF JPEG".
They seem to indicate a sub category of JPEG in some way. What I have found out is that the FF D8 FF E0 magic indicates a "JFIF JPEG" whereas the FF D8 FF E1 indicates an "EXIF JPEG".
编辑:在Google缓存中找到了此文件: http://tinyurl.com/ydtjpjw (有趣的是,它表明三星还有更多变体)
Edit: Found this one in a google cache: http://tinyurl.com/ydtjpjw (interesting because it indicates that Samsung has a few more variations)
这篇关于iPhone JPG图像具有非标准魔术字节ff d8 ff e1?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!