Return-Path: <tiff-bounces@remotesensing.org>
Received: from inmx014.isp.belgacom.be (inmx014.isp.belgacom.be [195.238.2.217])
        by mailst035.isp.belgacom.be (8.12.11/8.12.11/Skynet-MAILSTORE-2.14) with ESMTP id j0SJt0lQ009660
        for <joris.at.lebbeke@skynet.be>; Fri, 28 Jan 2005 20:55:00 +0100
        (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 inmx014.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-2.32) with ESMTP id j0SJsjaa015079
        for <joris.at.lebbeke@skynet.be>; Fri, 28 Jan 2005 20:54:48 +0100
        (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 86BCD61033C; Fri, 28 Jan 2005 14:46:04 -0500 (EST)
X-Original-To: tiff@remotesensing.org
Delivered-To: tiff@remotesensing.org
Received: from scooby.simplesystems.org (scooby.simplesystems.org
	[65.66.246.67])
	by xserve.flids.com (Postfix) with ESMTP id 5C24760C46D
	for <tiff@remotesensing.org>; Thu, 27 Jan 2005 15:50:01 -0500 (EST)
Received: from blade.simplesystems.org (blade.simplesystems.org [65.66.246.74])
	by scooby.simplesystems.org (8.12.10+Sun/8.12.10) with ESMTP id
	j0RKGUVL002797; Thu, 27 Jan 2005 14:16:30 -0600 (CST)
Date: Thu, 27 Jan 2005 14:16:30 -0600 (CST)
From: Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
X-X-Sender: bfriesen@blade.simplesystems.org
To: Antoine <melser.anton@gmail.com>
Subject: Re: [Tiff] TIFFSetField bug?
In-Reply-To: <41F9483F.6060202@gmail.com>
Message-ID: <Pine.SOC.4.60.0501271411180.7604@blade.simplesystems.org>
References: <92d3a495050127072639c5017e@mail.gmail.com>
	<Pine.SOC.4.60.0501271033030.7604@blade.simplesystems.org>
	<41F9483F.6060202@gmail.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: Tiff mailing list <tiff@remotesensing.org>
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: 68205652be2178a96e2577eb492aad1a

On Thu, 27 Jan 2005, Antoine wrote:

> This is from the manpage of TIFFSetField:
>
> ...
> TIFFTAG_ROWSPERSTRIP            1      uint32             - must be > 0
> ...
>
> So I can therefore only conclude that when I call this in my hacked tiffcp:
>
> TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, 8192);
>
> and get:
>
> antt@tux tools $ ./tiffdump testout.tif
> testout.tif:
> Magic: 0x4949 <little-endian> Version: 0x2a
> Directory 0: offset 49640 (0xc1e8) next 0 (0)
> SubFileType (254) LONG (4) 1<2>
> ImageWidth (256) SHORT (3) 1<2489>
> ImageLength (257) SHORT (3) 1<3507>
> BitsPerSample (258) SHORT (3) 1<1>
> Compression (259) SHORT (3) 1<4>
> Photometric (262) SHORT (3) 1<0>
> FillOrder (266) SHORT (3) 1<1>
> StripOffsets (273) LONG (4) 1<8>
> Orientation (274) SHORT (3) 1<1>
> SamplesPerPixel (277) SHORT (3) 1<1>
> RowsPerStrip (278) SHORT (3) 1<8192>
> StripByteCounts (279) LONG (4) 1<49632>
> XResolution (282) RATIONAL (5) 1<300>
> YResolution (283) RATIONAL (5) 1<300>
> PlanarConfig (284) SHORT (3) 1<1>
> Group4Options (293) LONG (4) 1<0>
>
> That this must be a bug. I would love to have my pitiful knowledge of c shown 
> to be the problem!

I don't see the bug.  The use of uint32 is an API-level issue.  The 
TIFF specicification says that RowsPerStrip may be of type SHORT or 
LONG.  Elsewhere it says that readers should be able to support short 
sizes since they conserve space.  If libtiff writes a SHORT when a 
SHORT is large enough to support the value, then it is adhering to the 
TIFF specification.

Bob
======================================
Bob Friesenhahn
bfriesen@simple.dallas.tx.us
http://www.simplesystems.org/users/bfriesen
_______________________________________________
Tiff mailing list
Tiff@remotesensing.org
http://xserve.flids.com/mailman/listinfo/tiff
