Return-Path: <tiff-bounces@lists.maptools.org>
X-Original-To: info@awaresystems.be
Delivered-To: info@awaresystems.be
Received: from mx-q.b-one.net (mx-q.one.com [91.198.169.248])
	by mail9.b-one.net (Postfix) with ESMTP id 52C1740024F
	for <info@awaresystems.be>; Mon, 14 Jun 2010 08:20:52 +0200 (CEST)
Received: by mx-q.b-one.net (Postfix, from userid 106)
	id 4BE254BD8F35; Mon, 14 Jun 2010 08:20:52 +0200 (CEST)
X-Virus-Scanned: by one.com
X-Spam-Score: 0
X-Spam-Level: 
X-Spam-Status: No, score=0 tagged_above=0 required=4 tests=[none]
X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4
Received: from lists.maptools.org (lists.maptools.org [65.39.174.144]) by
 mx-q.b-one.net (Postfix) with ESMTP id 98BC04BD8F35 for
 <info@awaresystems.be>; Mon, 14 Jun 2010 08:20:51 +0200 (CEST)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by
 lists.maptools.org (Postfix) with ESMTP id A3A001D25F61A; Mon, 14 Jun 2010
 01:20:20 -0500 (EST)
Received: from csmtp3.one.com (csmtp3.one.com [91.198.169.23]) by
 lists.maptools.org (Postfix) with ESMTP id 250F41D0E5248 for
 <tiff@lists.maptools.org>; Mon, 14 Jun 2010 01:09:09 -0500 (EST)
Received: from awarec74cb3e1c (78-22-4-193.access.telenet.be [78.22.4.193])
 by csmtp3.one.com (Postfix) with ESMTP id 4947E24069D3; Mon, 14 Jun 2010
 06:09:09 +0000 (UTC)
Message-ID: <D4B873F7930446AE80F8CEAC34896A24@awarec74cb3e1c>
From: "Joris Van Damme \(AWare Systems\)" <info@awaresystems.be>
To: "Andreas Kleinert" <info@ar-kleinert.de>, "Tiff List"
 <tiff@lists.maptools.org>
References: <4C133908.1070407@ar-kleinert.de>
Date: Mon, 14 Jun 2010 08:09:14 +0200
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2900.5931
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5931
Subject: Re: [Tiff] libtiff and IPTC tag
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: TIFF and libtiff discussion <tiff.lists.maptools.org>
List-Unsubscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
 <mailto:tiff-request@lists.maptools.org?subject=unsubscribe>
List-Archive: <http://lists.maptools.org/mailman/private/tiff>
List-Post: <mailto:tiff@lists.maptools.org>
List-Help: <mailto:tiff-request@lists.maptools.org?subject=help>
List-Subscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
 <mailto:tiff-request@lists.maptools.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org

Andreas,

> However in tif_dirinfo.c within TIFFFieldInfo it is defined that
> libtiff expects LONG for TIFFTAG_RICHTIFFIPTC (custom field)...

This is the story of the egg and the many, many chickens.

Originally, there was one manufacturer that got it wrong, used LONG while 
the data is of mixed datatype, and therefore only makes sense as BYTE or 
UNDEFINED on the TIFF level. Adobe chose to duplicate that mistake, so as to 
remain compatible. LibTiff chose to duplicate Adobe's mistate, so as to 
remain compatible. As many chickens were hatched from that very first egg, 
endianness issues became aparant. Some brew complicated code to correct 
that, so as to remain compatible... But often that sort of code is either 
absent, or not working fully correctly. Hence, the attempts to remain 
compatible, turned out at least partly futile.

- The best way to write, is using BYTE or UNDEFINED.
- The best way to read, is interpret BYTE or UNDEFINED as expected.
- If datatype is LONG instead, read in your normal way (which probably 
includes byteswapping if endianness of file and machine don't match). Next 
try and interpret the data. If it doesn't make sense as valid IPTC data, 
byteswap it again, and retry interpreting it.


Best regards,

Joris 

_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
