TIFF and LibTiff Mail List Archive


1999.07.02 17:10 "Problem with byte order", by Thomas Ledoux
1999.07.03 05:50 "Re: Problem with byte order", by Niles Ritter

1999.07.02 17:10 "Problem with byte order", by Thomas Ledoux


I have recently find what seems to be a bug in the libtiff.

I need to generate multipage TIFF on a Sun but wanted to have them encoded in Intel order (little-endian). So I use the (not recommended) option "lL" during the TIFFOpen sequence to do that.

Everything goes right except for a little single problem that makes my files not TIFF-compliant. When I try to write a ASCII tag (like PageName), with a less that 4 bytes string, the string is written in the 4 bytes value/offset holder (which is normal) but in the reverse order...

The specification says that this holder has to be used in a left justified way:

"If the Value is shorter than 4 bytes, it is left-justified within the 4-byte Value Offset, i.e., stored in the lower-numbered bytes." but my string gets written in the 4 bytes like this:

     <garbage> <garbage> '\0' '1'

and not

     '1' '\0' <garbage> <garbage>

Is there any patch for this?