Is the 2nd and 3rd byte of a JPEG image always the APP0 or APP1 marker?

前端 未结 8 978
失恋的感觉
失恋的感觉 2020-12-10 17:18

I have a few different JPEG images I\'ve been testing with. As far as I\'ve seen the 0th and first bytes are always 0xFF and 0xD8.

The s

8条回答
  •  温柔的废话
    2020-12-10 17:50

    No, it certainly doesn't have to be that way. Reading Wikipedia.

    As far as I can tell, the APPn segments are just ways for applications to embed arbitrary data into the image file. Obviously, applications commonly take advantage of this and write 0xFF 0xEO or 0xFF 0xE1 bytes into the header, but it would be entirely plausible for an application to not do this and just go on with the image data. The first two bytes (0xFF and 0xD8) are mandatory, as they are the SOI (start-of-image) marker.

提交回复
热议问题