Ok, now I see where is the apparent issue. Some profiles may have incomplete or broken tags, lcms tries to fix them when reading, this is the case of, for example, old sRGB, which have empty unicode description.
The fixed tag is slightly different from the original found in the profile, it has the unicode string and therefore MD5 returns different digest codes. I agree it is confusing. Will try to fix this in 2.1 Obvious workaround is to compute MD5 before reading any tag. Regards Marti. Quoting Pierre Rousseau <pierre.rouss...@lumiscaphe.com>: > Hi Marti, > > Thanks a lot for testing. I should have given some code from the beginnin g, > sorry. > I tested the code you provided, and well... it does work fine, but only f or > ICC V4 profiles. For ICC V2 profiles, it exhibits the problem I mentioned . > Is this feature meant to be used only with v4 profiles ? > > Thanks, > Pierre > > > > -----Message d'origine----- > De : marti.ma...@littlecms.com [mailto:marti.ma...@littlecms.com] > Envoyé : mercredi 22 septembre 2010 11:17 > À : Pierre Rousseau > Cc : lcms-user@lists.sourceforge.net > Objet : Re: [Lcms-user] Varying ProfileID > > > Hi Pierre, > > Sorry, I can't reproduce this behaviour. I tried this: > > static > int CheckMD5(void) > { > cmsHPROFILE hProfile; > cmsUInt8Number ID[16], ID2[16]; > char buffer[4096]; > > hProfile = cmsOpenProfileFromFile("sRGBlcms2.icc", "r"); > if (hProfile == NULL) return 0; > > cmsMD5computeID(hProfile); > cmsGetHeaderProfileID(hProfile, ID); > > cmsGetProfileInfoASCII(hProfile, cmsInfoDescription, "en", "US", > buffer, 4096); > > cmsMD5computeID(hProfile); > cmsGetHeaderProfileID(hProfile, ID2); > > cmsCloseProfile(hProfile); > return (memcmp(ID, ID2, 16) == 0); > } > > > It works fine to me. > May I ask for a few lines of sample code that reproduces the issue? > Thanks! > Marti > > > Quoting Pierre Rousseau <pierre.rouss...@lumiscaphe.com>: > >> Hello Guys >> >> >> >> I'm witnessing a disturbing behavior with the MD5 functions in LCMS 2.0a , >> which I use to recognize identical profiles loaded from disk or embedded . >> >> Basically, loading a profile (say, from a file on disk) and computing it s >> MD5 (through cmsMD5computeID(p)) gives me one profile ID. >> >> Loading the same profile, getting its description (through >> cmsGetProfileInfoASCII(p, cmsInfoDescription, "en", "US", buffer, 4096)) > and >> then computing its MD5 gives me another profile ID. >> >> Should this be considered a bug or am I missing something ? Seen from th e >> outside with poor knowledge of ICC specs, this shouldn't make the two >> profiles different. >> >> >> >> Thanks for some hints on this point, and anyway congrats for this awesom e >> piece of software ! >> >> >> >> Regards >> >> Pierre Rousseau >> >> > > > > ------------------------------------------------------------------------------ Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev _______________________________________________ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user