AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

2003.05.19 18:13 "Libtiff saves 2k extra", by Bruno_Tenório_Ávila

Hello,

            Why does libtiff generates 2kbytes of extra size in their

files? The others tiff viewer’s saves 2kbytes less.

dst = TIFFOpen(lpFileName, "w");

TIFFSetField(dst, TIFFTAG_IMAGEWIDTH, width);

TIFFSetField(dst, TIFFTAG_IMAGELENGTH, height);

TIFFSetField(dst, TIFFTAG_BITSPERSAMPLE, 1);

TIFFSetField(dst, TIFFTAG_SAMPLESPERPIXEL, 1);

TIFFSetField(dst, TIFFTAG_ROWSPERSTRIP, height);

TIFFSetField(dst, TIFFTAG_COMPRESSION, COMPRESSION_CCITTFAX4);

TIFFSetField(dst, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISWHITE);

TIFFSetField(dst, TIFFTAG_FILLORDER, FILLORDER_MSB2LSB);

TIFFSetField(dst, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);

TIFFSetField(dst, TIFFTAG_XRESOLUTION, 200.0);

TIFFSetField(dst, TIFFTAG_YRESOLUTION, 200.0);

TIFFSetField(dst, TIFFTAG_RESOLUTIONUNIT, RESUNIT_NONE);

TIFFWriteEncodedStrip(dst, 0, r, width*height);

TIFFClose(dst);

Bruno Tenório Ávila
Res: 3228-9284
Cel: 9167-1910
bta@cin.ufpe.br

brunoavila@terra.com.br