AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2005.01.25 09:42 "[Tiff] change data type of a tag", by Antoine
2005.01.25 13:26 "[Tiff] Re: change data type of a tag", by Antoine
2005.01.27 10:26 "[Tiff] compiling under win2000/VC6", by Antoine
2005.01.27 15:26 "[Tiff] TIFFSetField bug?", by Antoine
2005.01.27 19:59 "Re: [Tiff] TIFFSetField bug?", by Antoine
2005.01.27 18:00 "Re: [Tiff] TIFFSetField bug?", by
2005.01.27 18:35 "Re: [Tiff] TIFFSetField bug?", by Antoine
2005.01.27 20:05 "Re: [Tiff] TIFFSetField bug?", by Antoine
2005.01.27 20:16 "Re: [Tiff] TIFFSetField bug?", by Bob Friesenhahn
2005.01.28 16:03 "[Tiff] planarconfig", by Antoine
2005.01.28 20:54 "Re: [Tiff] planarconfig", by Bob Friesenhahn
2005.01.28 22:54 "Re: [Tiff] planarconfig", by Antoine
2005.01.28 23:02 "Re: [Tiff] planarconfig", by Bob Friesenhahn
2005.01.29 11:50 "Re: [Tiff] planarconfig", by Antoine

2005.01.27 19:59 "Re: [Tiff] TIFFSetField bug?", by Antoine

Bob Friesenhahn wrote:

> Does the same bug exist in 3.7.1 or the CVS/development version?

>
> Bob
>
> On Thu, 27 Jan 2005, Antoine wrote:
>

In the windows 3.6.1 source code release, TIFFSetField will not set RowsPerStrip properly. The field is either not converted from its original status as a short (i.e., when it gets read in, even if it is read into a uint32, and TIFFSetField is passed this variable, it doesn't change the value to a long), or gets set to some ridiculous figure. I know that this it is possible to set it correctly because the tifftag.exe that can be found at http://www.piorek.net/pub/WINDOWS_TOOLS/tifftag.exe is able to change the datatype, and when it does does not bork the value.

Calling from tiffset and from my own code is the same. And further modification to the value after it has been changed to a long is impossible (so two calls does nothing).

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!

Cheers
Antoine