AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2004.06.29 04:44 "[Tiff] Saving Exif with TiffLib", by Alex Kon
[...]
2004.08.16 21:48 "Re: [Tiff] Re: ICC profile in tiff file on windows", by Alexander Cohen
2004.08.18 17:55 "Re: [Tiff] Re: ICC profile in tiff file on windows", by Phillip Crews
[...]

2004.08.18 17:55 "Re: [Tiff] Re: ICC profile in tiff file on windows", by Phillip Crews

On 16-Aug-04, at 5:04 PM, Chris Cox wrote:

At 4:55 PM -0400 8/16/04, Alexander Cohen wrote:

>>>>Alexander,


>

>Your code that parses TIFF tags and TIFF data types should not be

>>>>>messing with the ICC profile data. Code that works with ICC profiles

>that run on a Windows platform knows that all the ICC profile >is big endian ( like an "MM" TIFF file ) and should do the proper >byte swapping for shorts and longs inside the ICC profile code.

>

>BUT: if you try to read a short or long from an ICC profile with >Windows code, the bytes will be in the wrong order.

>

>The moral of the story: you might be trying to do something that >a Color Management System library should do for you.

>Nope, im just reading the ICC profile tag, and taking that data and

>>passing it to the "OpenColorProfile" function in the windows API. The

>same works on mac (with the mac version of the call).

Sigh.

HOW are you reading the tag data?

I made some simple getters for the icc profile since TIFFGetTag was not working on windows like it should, but my way gives me the same results, here's my code:

void
TIFFGetICCProfileData(TIFF* tif, void * data )
{
        if (!data) return;
        TIFFDirectory* td = &tif->tif_dir;
        memcpy( data, td->td_profileData, td->td_profileLength );
}

int
TIFFGetICCProfileSize(TIFF* tif )
{
        TIFFDirectory* td = &tif->tif_dir;
        return td->td_profileLength;
}

>>If you write it to a file, the file should be identical between Macintosh >>and Windows.

my thoughts the same.

My Windows program uses:

   TIFFGetField(tif, TIFFTAG_ICCPROFILE, &icclen, &iccinfo);

to retrieve the color profile, and I haven't seen any problems or crashes.

If you would like me to check if your a TIFF file works properly, feel free to e-mail a copy and I'll let you know what I find.

Kind regards,
Phillip