-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No function to retrieve cmsProfileID #38
Comments
Hi, the functions to get/set/compute profileID are available since lcms2-2.0 There is documentation in the API reference manual |
Thanks, I didn't find the section for them since it was so far at the bottom. On a related note, do you know why identically generated profiles end up with different profile IDs? eg. see this file #include <stdio.h>
#include <lcms2.h>
int main() {
cmsCIExyY d65 = {0.3127, 0.3290, 1.0};
cmsCIExyYTRIPLE prim_rec709 = {
.Red = {0.64, 0.33, 1.0},
.Green = {0.30, 0.60, 1.0},
.Blue = {0.15, 0.06, 1.0},
};
cmsToneCurve *tc = cmsBuildGamma(NULL, 2.2);
cmsHPROFILE p = cmsCreateRGBProfile( &d65, &prim_rec709, (cmsToneCurve*[3]) { tc, tc, tc });
cmsSetProfileVersion(p, 2.0);
cmsMD5computeID(p);
cmsProfileID id;
cmsGetHeaderProfileID(p, id.ID8);
printf("id: 0x%x%x%x%x\n", id.ID32[0], id.ID32[1], id.ID32[2], id.ID32[3]);
cmsCloseProfile(p);
cmsFreeToneCurve(tc);
return 0;
} Building the program and running it a few times gives me results like this:
Do you know what causes that? |
ICC profiles holds a creation time stamp that contributes to the MD5 Regards |
I see a definition for cmsProfileID in lcms2.h, and it's referenced inside cmsICCHeader, but I cannot find any way to retrieve this information through the actual LittleCMS 2 API.
Is it possible to get the profile ID somehow? If not, could it be added?
My use case: I want to quickly figure out if an ICC profile has changed, as that invalidates my cache. Currently I am comparing the entire file against a reference copy, but that doesn't play nicely with profiles loaded from memory (or generated from scratch), and it's also less efficient to store a full copy of a potentially large ICC profile rather than just a 128-bit hash.
The text was updated successfully, but these errors were encountered: