-
Notifications
You must be signed in to change notification settings - Fork 79
Description
Follow-up to KhronosGroup/glTF#2471.
Some JPEG textures used in this repo violate the glTF 2.0 specification, namely they do not contain a JFIF marker and in some cases also contain Exif blocks. Additionally, some JPEG textures contain Adobe's color transform markers, embedded ICC profiles and/or thumbnails.
Why not having JFIF markers is a problem
The JPEG standard does not define any color model or channel semantics. An arbitrary JPEG file may contain up to 255 color channels for a single image. This is partially resolved by additional standards like ITU-T Rec T.871 (aka JFIF), ITU-T Rec T.872, and CIPA DC-008 (aka Exif).
Unfortunately, the amount of possible proprietary and standardized combinations of different markers is so large that it's not feasible for a glTF implementation to support arbitrary JPEG files. Although some non-standard marker configurations are supported by popular libraries and image-editing apps, it's not reasonable to expect glTF implementations to knowingly support them as well.
The most portable and safe option is to require JFIF markers to restrict the JPEG scope as much as possible.
JPEG files not having JFIF markers are already invalid per the glTF 2.0 spec and will be flagged as errors by the next validator version.
Why having Exif markers is a problem
The Exif standard is officially incompatible with JFIF because both specs require putting their respective markers immediately after SOI. Therefore, a valid JFIF file having an Exif block would be invalid as per the Exif specification. On top of that, there are thousands of various Exif fields that may or may not affect image interpretation. glTF implementations should not need to handle that.
Why having Adobe's color transform markers is a problem
Such markers are generally incompatible with JFIF and they are redundant in all existing assets anyway. Their intended purpose is to better support printing systems.
Why having embedded ICC profiles is a problem
glTF 2.0 explicitly defines that all color textures are treated as having ITU-R 709 color gamut with non-linear sRGB encoding. Any custom ICC profile must be ignored. Opening a JPEG image with a custom color profile in an image editor may yield different results than using the same image as a glTF texture.
Why having thumbnails is a problem
They require extra storage and increase transmission size while being inaccessible to glTF applications anyway.