openpreserve / jhove

File validation and characterisation.
http://jhove.openpreservation.org
Other
171 stars 79 forks source link

Wiki: Additional info for JPEG-HUL-9 #698

Closed marhop closed 2 years ago

marhop commented 2 years ago

Hi,

Apparently the Wiki cannot be edited?! I'd like to suggest the following info be added to the JPEG-HUL-9 "File does not begin with SPIFF, Exif or JFIF segment" entry. Feel free to add further improvements!

Cheers, Martin


Impact

When this error is raised for a well-formed but not valid file it typically hints at an uncommon but not necessarily broken file structure. From the JHOVE documentation:

A file which consists of a JPEG data stream, but does not contain the required segments for a JFIF, SPIFF, Exif, JTIP, or JPEG-LS file is considered well-formed but not valid.

In particular, the most common JPEG file formats JFIF and Exif expect a file to start with the hex sequence ffd8 ffe0 (SOI + APP0) or ffd8 ffe1 (SOI + APP1), respectively. However, the original JPEG specification (ITU-T Rec. T.81, Annex B) allows other data immediately after the SOI marker (e.g., a DQT marker) as well. That may not be in line with one of the abovementioned formats though which restrict the file structure in one way or another, leading to this error.

So as long as a file with this error opens correctly in a viewer (better yet, in several different viewers) and has no other errors it may just be an uncommon JPEG variant, making the final verdict a file format policy question.

Remediation

As long as this is the only error in a file one of the following measures may be appropriate:

asciim0 commented 2 years ago

seems like i can edit it. just added your info to JPEG-HUL 9. Can you confirm you can see it?

thanks for sharing!

marhop commented 2 years ago

Looks good to me, thank you!

I wonder though - am I just too dumb to edit the Wiki myself or is this intentional? (Not that I expect you to know, but maybe @carlwilson?)