Return-Path: <tiff-bounces@lists.maptools.org>
Received: from mailgate109.isp.belgacom.be (mailgate109.isp.belgacom.be [195.238.6.92])
        by inmx005.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-IN-2.32) with ESMTP id l44D9OlV017995
        for <joris.at.lebbeke@skynet.be>; Fri, 4 May 2007 15:09:25 +0200
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from r153.dmsolutions.ca (HELO duke.maptools.org) ([209.217.116.153])
  by in.mx.skynet.be with ESMTP; 04 May 2007 15:09:24 +0200
Received: from duke.maptools.org (duke.maptools.org [127.0.0.1])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id l44D2Zxb023964;
	Fri, 4 May 2007 09:02:55 -0400
Received: from outmx036.isp.belgacom.be (outmx036.isp.belgacom.be
	[195.238.6.173])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id l44D2Xrr023960
	for <tiff@lists.maptools.org>; Fri, 4 May 2007 09:02:33 -0400
Received: from outmx036.isp.belgacom.be (localhost.localdomain [127.0.0.1])
	by outmx036.isp.belgacom.be (8.13.4/8.13.4/Debian-3sarge3) with ESMTP
	id l44D2Vlu013863
	for <tiff@lists.maptools.org>; Fri, 4 May 2007 15:02:32 +0200
Received: from AWareCore2Duo (76.143-246-81.adsl-dyn.isp.belgacom.be
	[81.246.143.76])
	by outmx036.isp.belgacom.be (8.13.4/8.13.4/Skynet-OUT-2.22) with SMTP
	id l44D2Trf013828; Fri, 4 May 2007 15:02:29 +0200
	(envelope-from <joris.at.lebbeke@skynet.be>)
Message-ID: <003101c78e4c$796fb090$0201a8c0@AWareCore2Duo>
From: "Joris" <joris.at.lebbeke@skynet.be>
To: "mikk" <mikk@go2.pl>, <tiff@lists.maptools.org>
References: <463B1E26.3030805@go2.pl> <463B2B3D.9030508@go2.pl>
Subject: Re: [Tiff] TIFFSetField and float values
Date: Fri, 4 May 2007 15:02:28 +0200
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset="ISO-8859-2";
	reply-type=response
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Cc: 
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.4
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>
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org
X-UIDL: 000000000023ceae.0000235b
X-MSP-STORE: Fri, 04 May 2007 15:09:28 +0200
Status:   

mikk,

mikk wrote:
> Oh, my, I've found the reason. Digging into the source code I realized
> that TIFFSetField
> gets the parameter from va_arg as double:
> (From tif_dir.c,v 1.72 2006/03/15 12:49:35, line 234:)
> // ...
> case TIFFTAG_XRESOLUTION:
>         td->td_xresolution = (float) va_arg(ap, double);
>         break;
> // ...
>
> When I pass argument of type double, the tag saves the value properly.
> Looks like an error in documentation (TIFFSetField.3tiff.html)?

I would agree... but I suspect other compilers may behave differently. I 
suspect that passing a float, as per documentation, would work for most, but 
passing a double will work for all. I've also tried changing the code you 
quote from tif_dir.c to va_arg(ap,float), but that doesn't work on our 
Borland compilers at all (and likely it will not work on most other 
compilers either, I think). So I'm about to propose to change the 
documention to specify a double parameter as part of the next update.


Best regards,

Joris Van Damme
info@awaresystems.be
http://www.awaresystems.be/
Download your free TIFF tag viewer for windows here:
http://www.awaresystems.be/imaging/tiff/astifftagviewer.html

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