1999.11.25 06:01 "Re: byte order of >8bpp data", by Tom Lane
Note that the TIFFIsByteSwapped() documentation in the TIFFquery.3t man page say:
> TIFFIsByteSwapped returns a non-zero value if the image data was in a > different byte-order than the host machine. Zero is returned if the image > data and local host byte-orders are the same. Data samples that are more > than 8 bits wide must be byte-swapped by the application.
The statement that "data samples that are more than 8 bits wide must be byte-swapped by the application" appears to be wrong, and I will correct the man page unless someone can explain why it shouldn't be changed.
Actually, it depends on how the application is reading the file; with TIFFReadStrip and higher-level functions, the app can expect to receive data in local host byte order, but with TIFFReadRawStrip etc, the app would need to do its own decoding (both decompression and byte swapping). So TIFFIsByteSwapped() offers a useful bit of info for an app that wants to get down and dirty.
I think the code is probably OK, but the documentation needs to be upgraded to explain the alternatives more thoroughly...
regards, tom lane