Re: [Lcms-user] ICC Profile description tag not read correctly
An ICC-based CMM for color management
Brought to you by:
mm2
From: Noel C. <NCa...@Pr...> - 2018-09-17 14:14:41
|
Hi Angel, I took your question as an opportunity to familiarize myself more with the Little CMS source code. Since you did not specify a language, this comment, from the internal implementation of _cmsMLUgetWide(), states that the first description found will be returned. In the case of your profile it's the "ASCII sRGB IEC61966-2.1" description. // The algorithm first searches for an exact match of country and language, if not found it uses // the Language. If none is found, first entry is used instead. Are you suggesting that the above code should be changed so that it chooses a wide character description over the narrow character one if the wide character cmsGetProfileInfo() function is used, and the narrow character description preferentially only if the cmsGetProfileInfoASCII() function is used? I suspect making such a change could break other software that already depends on the above-described behavior, though it's not explicitly documented either way in the manual. Only Marti can speak to whether design changes would make sense and fit his original goals. -Noel Carboni ProDigital Software From: Angel Sánchez [mailto:sal...@gm...] Sent: Mon, September 17, 2018 8:12 AM To: lcm...@li... Subject: [Lcms-user] ICC Profile description tag not read correctly Hello folks! We are using LCMS to read some profile descriptions from images and with this one looks like it can't read the Unicode part of the tag, and instead reads the ASCII one. Here is the code we are using: ------------ wchar_t desc[2048]={0}; if (m_cmshProfile != NULL) { cmsMLU * pDescTag = (cmsMLU *) cmsReadTag(m_cmshProfile, cmsSigProfileDescriptionTag); if (!cmsGetProfileInfo(m_cmshProfile, cmsInfoDescription, cmsNoLanguage, cmsNoCountry, desc, sizeof(desc))) return NULL; } ------------ In this case desc gets this characters: ASCII sRGB IEC61966-2.1 And instead it should be Unicodé sRGB IEC61966-2.1 This happens on windows using Visual Studio 2017 and macOS. If I extract the ICC profile with ImageMagick and convert to xml with IccXML ( https://sourceforge.net/projects/iccxml/ ), I can see the following tags: --------- <textDescriptionType> <TagSignature>desc</TagSignature> <ASCII><![CDATA[ASCII sRGB IEC61966-2.1]]></ASCII> <Unicode><![CDATA[Unicodé sRGB IEC61966-2.1]]></Unicode> </textDescriptionType> --------- Looks like it is getting the ASCII tag instead the Unicode one. How we should read the Unicode tag? I have attached the ICC profile. Feel free to contact me for any questions, suggestions and advice. Thanks, Angel |