OpenImageIO/oiio — pull request #451 by lgritz (2012-11-05 20:17:41+00:00)
Title: oiiotool & iinfo: bug fix with SHA-1 hash

We were not doing a seek_image before the read for the SHA-1 hash, so in the case of a MIP-mapped image, we were pointed to the lowest-res MIP level, not the highest-res level. That could result in two images that were quite different having the same hash if they had the exact same average color.

Note: this did NOT affect maketx/TextureSystem's detection of duplicate textures, which always hashed the original pixels correctly.

Also put in a check for errors in the read_image call used to read the buffer that is hashed.