OpenImageIO/oiio — pull request #798 by lgritz (2014-02-05 01:32:41+00:00)
Title: IC/TS: Don't honor SHA-1 fingerprint for files not written by OIIO.

Evil edge case: user creates MIP-mapped texture with maketx (which
writes the hash into either "oiio:SHA-1" metadata, or for formats that
don't support arbitrary metadata, into the "ImageDescription"), then
user alters the image with software like PhotoShop and somehow
re-outputs a MIP-map and figures they don't need to re-maketx it. Yet
it still contains the metadata with the SHA-1 of the original image, and
so will be recognized by the ImageCache/TextureSystem as an exact
duplicate of the original. Oops.

This patch adds a heuristic wherein if the "Software" metadata does
not start with "OpenImageIO" (which it will, if written by maketx),
the SHA-1 fingerprint will be forgotten. (In particular, we believe
that PhotoShop will rewrite the "Software" metadata.)

This is not perfect -- it can still incorrectly classify an image as a
duplicate if it was altered by a program that does not overwrite the
"Software" metadata, yet alters the pixels. So don't do that, dummy!