AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2002.12.04 11:25 "Bugs in tiff_dirread.c?", by Torsten Hentschel
2002.12.04 14:36 "Re: Bugs in tiff_dirread.c?", by Dwight Kelly
2002.12.05 11:41 "Re: Bugs in tiff_dirread.c?", by Torsten Hentschel
2002.12.05 13:10 "Re: Bugs in tiff_dirread.c?", by Dwight Kelly
2002.12.05 15:38 "Re: Bugs in tiff_dirread.c?", by Torsten Hentschel
2003.01.15 15:59 "libtiff 3.6.0 Beta", by Frank Warmerdam
2003.01.15 18:41 "IFD Location", by scott
2003.01.15 20:11 "Re: IFD Location", by Dwight Kelly
2003.01.28 19:28 "ifd offset problem?", by Bob Herion
2003.01.31 16:52 "Opening compressed images in "update" mode.", by Frank Warmerdam
2003.02.03 07:54 "RE: Opening compressed images in "update" mode.", by Rainer Wiesenfarth

2002.12.04 11:25 "Bugs in tiff_dirread.c?", by Torsten Hentschel

<x-flowed>Hi,

when I am looking at the source of tiff_dirread.c (v3.5.7, Rev. 1.6) I am wondering, whether the functions

    TIFFFetchShortArray and
    TIFFFetchByteArray

are buggy when used in a special case. I suspect they return the wrong order of the values, if the value array fits into the encoding of the directory entry's offset.

I am asking this, because when I use ``tiffdump'' to show the directory content of the example image jim___gg.tif from ftp://ftp.remotesensing.org/pub/libtiff/v3.4pics.tar.gz, the last tag is printed as:

    HalftoneHints (321) SHORT (3) 2<254 1>

But when I use ``tiffdump'' from DaVince Tools (http://www.davince.com) it prints the last tag as

    Tag HalftoneHints 321 : type SHORT : count 2<1 254>

When I am looking at the encoding of the tag using a hex dump utility (tag offsets's encoding starts at 0xbe) I see the following bytes (in that order):

     01 00 fe 00

Byte order of that file is obviously little endian.

What I suspect now is, both functions (TIFFFetchShortArray and TIFFFetchByteArray) use dir->tdir_offset to decode the values from, if the value fits into there. They do use tif->tif_header.tiff_magic to determine the byte order. But the value of dir->tdir_offset has already been brought into host byte order, right?

Please tell me if I am wrong or not, I am very curious about this.

Kind reagards,

    Torsten Hentschel

--
Torsten Hentschel
Team Lead Software Development

AuthentiDate International AG
Grossenbaumer Weg 6
40472 Duesseldorf

phone  : +49 (0)211 43 69 89 63
fax    : +49 (0)211 42 69 89 19
Email  : torsten.hentschel@authentidate.de

Erfahren Sie mehr ueber AuthentiDate:
- Workshop elektronische
       Rechnungsstellung, D?sseldorf,
       13.02.2003
Weitere Infos unter www.AuthentiDate.de

To subscribe or unsubscribe email tiff-request@olympiakos.com with subscribe
or unsubscribe in the email body. Libtiff home page: http://www.libtiff.org
</x-flowed>