Return-Path: <tiff-bounces@remotesensing.org>
Received: from inav002.isp.belgacom.be (inav002.isp.belgacom.be [195.238.3.145])
        by mailst035.isp.belgacom.be (8.12.11/8.12.11/Skynet-MAILSTORE-2.14) with ESMTP id i9RKnlgx023857
        for <joris.at.lebbeke@skynet.be>; Wed, 27 Oct 2004 22:49:47 +0200
        (envelope-from <tiff-bounces@remotesensing.org>)
Received: from inas011.isp.belgacom.be (localhost [127.0.0.1])
        by inav002.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-AV-3.00) with ESMTP id i9RKnaFx020986
        for <joris.at.lebbeke@skynet.be>; Wed, 27 Oct 2004 22:49:36 +0200
        (envelope-from <tiff-bounces@remotesensing.org>)
Received: from inmx010.isp.belgacom.be (inmx010.isp.belgacom.be [195.238.2.73])
        by inas011.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-AS-2.03) with ESMTP id i9RKnU2j003157
        for <joris.at.lebbeke@skynet.be>; Wed, 27 Oct 2004 22:49:32 +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 inmx010.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-2.32) with ESMTP id i9RKnPRS016020
        for <joris.at.lebbeke@skynet.be>; Wed, 27 Oct 2004 22:49:27 +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 9AFC8419B75; Wed, 27 Oct 2004 16:48:46 -0400 (EDT)
X-Original-To: tiff@remotesensing.org
Delivered-To: tiff@remotesensing.org
Received: from ihemail1.lucent.com (ihemail1.lucent.com [192.11.222.161])
	by xserve.flids.com (Postfix) with ESMTP id 59DCC419B4E
	for <tiff@remotesensing.org>; Wed, 27 Oct 2004 16:47:53 -0400 (EDT)
Received: from ihmail.ih.lucent.com (h135-1-218-70.lucent.com [135.1.218.70])
	by ihemail1.lucent.com (8.12.11/8.12.11) with ESMTP id i9RKlnOA002269
	for <tiff@remotesensing.org>; Wed, 27 Oct 2004 15:47:50 -0500 (CDT)
Received: from static.ih.lucent.com (static.ih.lucent.com [135.185.166.118])
	by ihmail.ih.lucent.com (8.11.7+Sun/EMS-1.5 sol2)
	id i9RKlmf22970; Wed, 27 Oct 2004 15:47:48 -0500 (CDT)
Received: from static.ih.lucent.com (localhost [127.0.0.1])
	by static.ih.lucent.com (8.12.8/8.9.3) with ESMTP id i9RKlnOa013266
	for <tiff@remotesensing.org>; Wed, 27 Oct 2004 15:47:49 -0500
Received: (from psfales@localhost)
	by static.ih.lucent.com (8.12.8/8.12.8/Submit) id i9RKlnYX013261
	for tiff@remotesensing.org; Wed, 27 Oct 2004 15:47:49 -0500
Date: Wed, 27 Oct 2004 15:47:49 -0500
From: Peter Fales <psfales@lucent.com>
To: tiff@remotesensing.org
Message-ID: <20041027204046.GF5757@lucent.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <mailman.83.1098908537.515.tiff@remotesensing.org>
User-Agent: Mutt/1.4.1i
User-Agent: Mutt/1.4.1i
Subject: [Tiff] Possible bug in tiff2ps
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: ac1b202a5b920f91d927d3525e19e5a5

tiff2ps (from 3.7.0) is failing on on my Darwin (Mac OS/X) system. It
looks like the problem is in setupPageState() where the wrong 
value is returned from TIFFGetField(tif, TIFFTAG_XRESOLUTION, &xres)

xres is a double, but in TIFFGetField(), which in turn calls 
_TIFFVGetField, we eventually get to this line in tif_dir.c, where 
the pointer is being treated as a float.:

        case TIFFTAG_XRESOLUTION:
            *va_arg(ap, float*) = td->td_xresolution;
            break;

I'm not sure it's the best fix, but this works for me:

diff -ur tiff-3.7.0/tools/tiff2ps.c tiff-3.7.0.new/tools/tiff2ps.c
--- tiff-3.7.0/tools/tiff2ps.c	2004-10-14 12:53:28.000000000 -0500
+++ tiff-3.7.0.new/tools/tiff2ps.c	2004-10-27 15:36:18.000000000 -0500
@@ -411,7 +411,7 @@
 static void
 setupPageState(TIFF* tif, uint32* pw, uint32* ph, double* pprw, double* pprh)
 {
-	double xres = 0.0, yres = 0.0;
+	float xres = 0.0, yres = 0.0;
 
 	TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, pw);
 	TIFFGetField(tif, TIFFTAG_IMAGELENGTH, ph);

-- 
Peter Fales			  Lucent Technologies, Room 1C-436
N9IYJ            		  2000 N Naperville Rd PO Box 3033
internet: psfales@lucent.com	  Naperville, IL 60566-7033
			 	  work:	(630) 979-8031


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