grid
grid copied to clipboard
Read ExifInteropDirectory
What does this change?
This reads an additional Exif directory using metadata-extractor: ExifInteropDirectory. It contains only two tags. We only care about one of them: InteropIndex. Together with already read Color Space, it will help us detect images straight from cameras that are in AdobeRGB colour space, but have no embedded ICC profile. It will help us fix this issue.
How can success be measured?
We are ready to gather information needed to fix an issue, ~before we perform the migration.~ (voices of reason rightly recommended a code-frieze until we know how the migration goes…).
Screenshots

Who should look at this?
Tested? Documented?
- [x] locally by committer
- [ ] locally by Guardian reviewer
- [x] on the Guardian's TEST environment
- [ ] relevant documentation added or amended (if needed)
I’m not convinced this is the best way: reading this otherwise useless directory. Maybe instead, we should perform all the needed sniffing and record the outcome in colourModelInformation.DCF-EXIF-impliedAdobeRGB (true, false) or whatever sounds better?
Pseudo-code for FileMetadataReader.scala:
- if
mimeType=JpegAND - if
fileMetadata.iccdoesn’t exist AND - if
ExifDirectoryBase.TAG_COLOR_SPACE=UndefinedAND - if
ExifInteropDirectory."Interoperability Index"=Uknown (R03)- set
colourModelInformation.DCF-EXIF-impliedAdobeRGBtotrue
- set
- else set
colourModelInformation.DCF-EXIF-impliedAdobeRGBtofalse(or drop whole key? seems worse option)
And then one day, use this new value to apply AdobeRGB colour profile while creating thumbnails and crops (because we currently can’t for live preview).
At least with my Nikon DSLR, the JPEGs provide all necessary information to reconstruct an AdobeRGB profile:
- TIFF WhitePoint (IFD0) = ...
- TIFF PrimaryChromaticities (IFD0) = ...
- Exif ColorSpace (Exif IFD) = Uncalibrated
- Exif Gamma (Exif IFD) = 2.2
Just shove the white point, chromaticities, and gamma curve into your CMM, you'll get Adobe RGB.
More information: https://ninedegreesbelow.com/photography/embedded-color-space-information.html