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
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.