Why are there two headers within a jpg file?


I’ve been working with Python to create an image viewer:

I noticed that when I was working with one of the files that it had two headers? Or at least two occurrences of JFIF, which I thought was unusual. Is there any particular reason that the file is structured like this?

Here is a sample of the file:

enter image description here

See lines starting offset 0 and 812


It looks like a thumbnail resource, judging from its ID being 0x040C. To find the ID, look at the line with 8BIM...New Win and read about: image resource blocks and image resource IDs.

Answered By – jan zegan

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published