CocoaDev

Edit AllPages

Given a NSBitmapImageRep, outputs the name of the color profile (if any):

Then, using a function provided by http://developer.apple.com/qa/qa2001/qa1205.html,

CFStringRef CopyProfileDescriptionCFString(CMProfileRef prof) { Str255 pName; ScriptCode code; CFStringRef str = nil; CMError err;

// for v4 profiles, try to get the best localized name from the 'desc'/'mluc' tag
err = CMCopyProfileLocalizedString(prof, cmProfileDescriptionTag, 0,0, &str);
// if that didn't work...
if (err != noErr)
{
    // for Apple's localized v2 profiles, try to get the best localized name from the 'dscm'/'mluc' tag
    err = CMCopyProfileLocalizedString(prof, cmProfileDescriptionMLTag, 0,0, &str);
    // if that didn't work...
    if (err != noErr)
    {
        // for normal v2 profiles, get the name from the 'desc'/'desc' tag
        err = CMGetScriptProfileDescription( prof, pName, &code);
        // convert it to a CFString
        if (err == noErr)
        {
            str = CFStringCreateWithPascalString(0, pName, code);
        }
    }
}
return str; }

StephanBurlot