ExifTool Forum

General => Metadata => Topic started by: fpe2fpe on July 19, 2022, 09:22:31 AM

Title: validation if jpeg file
Post by: fpe2fpe on July 19, 2022, 09:22:31 AM
Is there  byte signature at the  start of a jpeg file that can be used to confirm it is a jpeg file?
Title: Re: validation if jpeg file
Post by: wywh on July 19, 2022, 10:15:18 AM
There seem to be four .jpg signatures:

xxd -l 4 -p jpg.jpg

ffd8ffe0 (JFIF JPEG)
ffd8ffe1 (EXIF JPEG)
ffd8ffee (?)
ffd8ffdb (?)


https://en.wikipedia.org/wiki/List_of_file_signatures

- Matti