Received: by whizzer.wpd.sgi.com (/911001.SGI)
	 id AA00760; Tue, 15 Feb 94 21:01:34 GMT
Received: from sgi.sgi.com by whizzer.wpd.sgi.com via SMTP (/911001.SGI)
	for /usr/people/sam/majordomo/wrapper resend -l tiff -h sgi.sgi.com -f tiff-owner -s -m "-oi -odq -om" tiff-list id AA00749; Tue, 15 Feb 94 13:01:30 -0800
Received: from pixar.pixar.com by sgi.sgi.com via SMTP (931110.SGI/910110.SGI)
	for tiff-relay@whizzer.wpd.sgi.com id AA26766; Tue, 15 Feb 94 13:01:26 -0800
Received: from roger.pixar.com by pixar.com with SMTP id AA26059
  (5.65c/IDA-1.4.4 for <tiff@sgi.com>); Tue, 15 Feb 1994 13:00:01 -0800
Received: by roger.pixar.com (/\==/\ Smail3.1.25.1 #25.26)
	id <m0pWWsA-0005CsC@roger.pixar.com>; Tue, 15 Feb 94 12:59 PST
Message-Id: <m0pWWsA-0005CsC@roger.pixar.com>
Date: Tue, 15 Feb 94 12:59 PST
From: mccoy@pixar.com (Dan McCoy)
To: Fillion.Roch803@xerox.com, tiff@sgi.sgi.com
Subject: Re: TIFFGetField bug
Cc: claude@roch803.mc.xerox.com
Sender: tiff-owner@sgi.sgi.com

>From: Claude_S._Fillion.ROCH803@xerox.com
>Subject: Re: TIFFGetField bug
>
>I found out why I was getting incorrect values returned from GetField,  strip
>chop support is enabled by default.  Strip chop support seems like a feature
>that could use some work.  One of the files I was testing with was only 5k and
>has a correct rowsperstrip value of 200.  Strip chop support changed the
>rowsperstrip to 372.  I would have assumed that if a file size is under 8k the
>rowsperstrip value would not be changed.

It's a bug.  (I guess I never make images that small.)
The routine "ChopUpSingleUncompressedStrip" should never increase the 
rowsperstrip value.
The fix is to add one line to tif_dirread.c (Well two, counting the comment.)

Dan McCoy    Pixar    mccoy@pixar.com

--------------------------------------------------------------
*** tif_dirread.c.orig  Thu Aug 26 21:27:30 1993
--- tif_dirread.c       Tue Feb 15 15:56:20 1994
***************
*** 1204,1209 ****
--- 1204,1211 ----
                rowsperstrip = 8192 / rowbytes;
                stripbytes = rowbytes * rowsperstrip;
        }
+       /* Never make rowsperstrip larger. */
+       if (td->td_rowsperstrip <= rowsperstrip) return;
        nstrips = howmany(bytecount, stripbytes);
        newcounts = (uint32*) CheckMalloc(tif, nstrips * sizeof (uint32),
                                "for chopped \"StripByteCounts\" array");


