`oiiotool --info -v out.tx` is reporting the "oiio:SHA-1" attribute that maketx stored in the metadata when the texture was created from a source image. That metadata is used to identify duplicate textures.
`oiiotool -hash` is computing a hash on the fly of the pixels in the image (not reporting metadata). They aren't expected to be the same. Why do they differ? If two textures have the same "oiio:SHA-1" metadata, they MUST be perfect substitutes for each other in the TextureSystem. So it's not enough to just hash the pixels at level 0 of the MIP-map, the maketx hash also folds in some of the parameters that control the way MIP levels are computed (for example, the filter name -- two textures with the same source pixels but different mip-to-mip filters will differ in the higher MIP levels and should not be considered duplicates). I admit that this is confusing. I think that long ago they were the same, until we realized that the pixels along were not enough for texture deduplication, it needed to know some other parameters to maketx. We probably could have chosen better nomenclature. Perhaps the maketx one should have been called "oiio:texfingerprint" or something. > On Mar 4, 2019, at 6:05 PM, Thiago Ize <[email protected]> wrote: > > I had a question about the SHA1 hashes in OIIO. If I run maketx on a random > image so that I get out.tx, and then for that same out.tx I do the following > commands which report different hashes: > > $ oiiotool --info -v out.tx | grep SHA > oiio:SHA-1: "2B93D027BA312B5A4113F7A2B1216967F1822E50" > $ oiiotool --hash out.tx > out.tx : 888 x 320, 3 channel, uint8 tiff (+mipmap) > SHA-1: A3BE1671AEF29389C350F84737873D972A427F51 > > Are these two hashes supposed to be different? If so, what are the > differences in the underlying data that causes a different hash? > > Thanks in advance for the clarification! -- Larry Gritz [email protected]
_______________________________________________ Oiio-dev mailing list [email protected] http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
