Solving TIFF malformation using exiftool

compared with
Current by Andrew Amato
on Sep 20, 2012 15:54.

Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (10)

View Page History
This meant that detection/correction suddenly became a lot easier: check for a discrepancy between image dimension and bit-depth, and the actual file size. (See below.) Similarly, because the pixel data was actually correct, we can correct the images by setting the correct value for the "BitsPerSample" tag.

We used the {code}exiftool{code} {{exiftool}} tool to do the detection/correction, because it supports so many options on the command line. In this case, we can do the maths to check "_expected_ file size" versus "_ACTUAL_ file size"; and we can also re-write the header-value we want to change.

*Caveats*: This technique, as described, will only work with single-channel (i.e., greyscale) images. {{Exiftool}} supports a limited (but impressive) amount of command-line manipulation. Unfortunately, for colour images, I couldn't figure out how to get it to do the maths on "number of bits per pixel", since they're represented (textually) as the number of bits _per channel_ (e.g., "8 8 8" vs. "24"). You could still apply the same techniques, and continue to use {{exiftool}}, but you'd probably just use it for metadata _extraction_, and wrap it in a shell/python/whatever script to do the analysis.

h5. Important questions and takeaways (see slides below)
h5. Evaluation

???
[~techmaurice]
We are going to incorporate this check in our QA process and request our vendors to do so as well. We will notify JHOVE developers as well to request them to incorporate this check.

h5. Slides from final day (images/PPT)

\[\]
[PowerPoint Slides|^SPRUCE - TIFFs.ppt]



!Slide1.PNG|border=1!

h3. We moved one bit\!

(I'd like to suggest this for "least work done to achieve a SPRUCE mashup solution" :-) )

h3. One bit makes a big difference:

!Slide10.PNG|border=1!

h3. Also: Consequences of bit-rot _can_ be severe\!
h3. Also: Consequences of (even single-)bit-rot can be subtle and severe\!