Return-Path: <tiff-bounces@remotesensing.org>
Received: from inmx012.isp.belgacom.be (inmx012.isp.belgacom.be [195.238.3.90])
        by mailst006.isp.belgacom.be (8.12.11/8.12.11/Skynet-MAILSTORE-2.14) with ESMTP id i7IHtjX2028733
        for <joris.at.lebbeke@skynet.be>; Wed, 18 Aug 2004 19:55:45 +0200
        (envelope-from <tiff-bounces@remotesensing.org>)
Received: from xserve.flids.com (adsl-065-083-169-202.sip.mco.bellsouth.net [65.83.169.202])
        by inmx012.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-2.32) with ESMTP id i7IHtVHb005891
        for <joris.at.lebbeke@skynet.be>; Wed, 18 Aug 2004 19:55:33 +0200
        (envelope-from <tiff-bounces@remotesensing.org>)
Received: from adsl-065-083-169-202.sip.mco.bellsouth.net (localhost [127.0.0.1])
	by xserve.flids.com (Postfix) with ESMTP
	id 8ED291ED180; Wed, 18 Aug 2004 13:55:15 -0400 (EDT)
X-Original-To: tiff@remotesensing.org
Delivered-To: tiff@remotesensing.org
Received: from cerious.com (unknown [66.193.70.90])
	by xserve.flids.com (Postfix) with ESMTP id CC08C1ED15C
	for <tiff@remotesensing.org>; Wed, 18 Aug 2004 13:55:13 -0400 (EDT)
Received: from [192.168.1.100] (HELO severian)
	by cerious.com (CommuniGate Pro SMTP 4.1.1)
	with ESMTP id 3199830 for tiff@remotesensing.org;
	Wed, 18 Aug 2004 13:55:33 -0400
Message-Id: <4.2.0.58.20040818135233.027ceae0@mail.cerious.com>
X-Sender: pcrews@mail.cerious.com
X-Mailer: QUALCOMM Windows Eudora Pro Version 4.2.0.58 
Date: Wed, 18 Aug 2004 13:55:12 -0400
To: tiff@remotesensing.org
From: Phillip Crews <pcrews@cerious.com>
Subject: Re: [Tiff] Re: ICC profile in tiff file on windows
In-Reply-To: <F77B1467-EFCD-11D8-995D-000A95B947DC@toomuchspace.com>
References: <p05210613bd46d1dcaa5f@[153.32.48.223]>
	<5.1.0.14.0.20040816162938.02320df8@corpmail.kodak.com>
	<98A00BB6-EFC6-11D8-995D-000A95B947DC@toomuchspace.com>
	<p05210613bd46d1dcaa5f@[153.32.48.223]>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed;
	x-avg-checked=avg-ok-521B6D36
X-BeenThere: tiff@remotesensing.org
X-Mailman-Version: 2.1.2
Precedence: list
List-Id: TIFF and libtiff discussion  <tiff.remotesensing.org>
List-Unsubscribe: <http://xserve.flids.com/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=unsubscribe>
List-Archive: <http://xserve.flids.com/pipermail/tiff>
List-Post: <mailto:tiff@remotesensing.org>
List-Help: <mailto:tiff-request@remotesensing.org?subject=help>
List-Subscribe: <http://xserve.flids.com/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=subscribe>
Sender: tiff-bounces@remotesensing.org
Errors-To: tiff-bounces@remotesensing.org
X-UIDL: fee071d75a06aeb5a8c4677ca4dd2610

At 05:48 PM 8/16/2004 , Alexander Cohen wrote:

>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

_______________________________________________
Tiff mailing list
Tiff@remotesensing.org
http://xserve.flids.com/mailman/listinfo/tiff
