1999.11.24 14:42 "byte order of >8bpp data", by Frank Warmerdam

1999.11.24 16:31 "Re: byte order of >8bpp data", by Tom Lane

I am trying to read a big-endian 16 bits per sample image on a little endian system, and it seems that libtiff isn't swapping the data into little endian order for me in TIFFReadTile() (or presumably TIFFReadStrip()).

My questions are:

It should be doing so. Look through the library code at the uses of the tif_postdecode filter. Perhaps you have found a bug wherein that function pointer isn't set up correctly in a particular situation.

Either; but in the former case the decompressor has to override tif_postdecode to prevent an extra swap from happening. The JPEG decompressor actually does this, and I think a couple others do too.

regards, tom lane
organizer, Independent JPEG Group