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:
- Am I wrong? Is libtiff swapping it, but I am missing it somehow?
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.
- An alternate form of this question is, do decompressors return image data in local system byte order or the byte order of the underlying tiff file?
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