2004.12.29 09:39 "[Tiff] TR:", by Jamel BEL HADJ BRAHIM

2004.12.29 10:37 "Re: [Tiff] TR:", by Joris Van Damme

Jamel,

How can I use FillOrder=Lsb2ToMsb, TIFFTAG_COMPRESSION = COMPRESSION_CCITTFAX4?

TIFFSetField(out, TIFFTAG_COMPRESSION, COMPRESSION_CCITTFAX4);

TIFFSetField(out, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISWHITE);

TIFFSetField(out, TIFFTAG_BITSPERSAMPLE, 2);

TIFFWriteEncodedStrip(out, 0, buffer, XSIZE * YSIZE);

Check the return value of TIFFWriteEncodedStrip, it probably indicates an error since you can't use FAX4 compression with 2bit per pixel data. Either

  1. you mean to write black and white, 1 bit per pixel data. In that case, correct the TIFFTAG_BITSPERSAMPLE value.
  2. or you mean to write 2 bit per pixel data. In that case, write a colormap, uses PHOTOMETRIC PALETTE, and use compression LZW or ADOBE_DEFLATE.

Joris Van Damme
info@awaresystems.be
http://www.awaresystems.be/
Download your free TIFF tag viewer for windows here:
http://www.awaresystems.be/imaging/tiff/astifftagviewer.html