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

  1. xbe) I see the following bytes (in that order):
  2. 00 fe 00
  3. Byte order of that file is obviously little endian.
  4. 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.
  5. But the value of dir->tdir_offset has already been brought into host byte order, right?
  6. Please tell me if I am wrong or not, I am very curious about this.
  7. Kind reagards,
  8. Torsten Hentschel
  9. --
  10. Torsten Hentschel
  11. Team Lead Software Development
  12. AuthentiDate International AG
  13. Grossenbaumer Weg 6
  14. 40472 Duesseldorf
  15. phone : +49 (0)211 43 69 89 63
  16. fax : +49 (0)211 42 69 89 19
  17. Email : torsten.hentschel@authentidate.de
  18. Erfahren Sie mehr ueber AuthentiDate:
  19. - 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>