2004.05.15 19:00 "[Tiff] TIFFWriteScanline endian swapping issue", by Robert Seidl

2004.05.15 20:39 "Re: [Tiff] TIFFWriteScanline endian swapping issue", by Bob Friesenhahn

uint32 row;
for( row=0; row<src.Size().fY; row++) {
         // fill buffer from our TImage data
         if (!TIFFWriteScanline(tif, tdata_t(src.PixelPtr(row)), row))
         TIFFError("WriteImage","failure in WriteScanline\n");
}

When I write my RGB or RGBA images this way, it looks like the bytes are written in such an order that other programs on my PC (like Photoshop, CompuPic) display the "wrong" (eg byte flipped) images.

>From your sample code I can't tell how "TImage data" is actually formatted. Maybe it is some sort of little-endian byte stream, or maybe it is some other format used by the non-tifflib software you are using.

Libtiff is used successfully by lots of software so any formatting errors are likely to be in the buffer that you pass to libtiff.

Bob

======================================
Bob Friesenhahn
bfriesen@simple.dallas.tx.us
http://www.simplesystems.org/users/bfriesen