Using ZIP compression for TIFF files & fix digikam compatibility (fixes issue 107 and issue 108)

This commit is contained in:
Michal Thoma
2010-09-04 15:28:10 +02:00
parent e1f277ae69
commit 1c409649c3

View File

@@ -690,18 +690,19 @@ int ImageIO::saveTIFF (Glib::ustring fname, int bps, bool uncompressed) {
} }
TIFFSetField (out, TIFFTAG_SOFTWARE, "RawTherapee 3"); TIFFSetField (out, TIFFTAG_SOFTWARE, "RawTherapee 3");
TIFFSetField (out, TIFFTAG_IMAGEWIDTH, width); TIFFSetField (out, TIFFTAG_IMAGEWIDTH, width);
TIFFSetField (out, TIFFTAG_IMAGELENGTH, height); TIFFSetField (out, TIFFTAG_IMAGELENGTH, height);
TIFFSetField (out, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT); TIFFSetField (out, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
TIFFSetField (out, TIFFTAG_SAMPLESPERPIXEL, 3); TIFFSetField (out, TIFFTAG_SAMPLESPERPIXEL, 3);
TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, height);
TIFFSetField (out, TIFFTAG_BITSPERSAMPLE, bps); TIFFSetField (out, TIFFTAG_BITSPERSAMPLE, bps);
TIFFSetField (out, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); TIFFSetField (out, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
TIFFSetField (out, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT); TIFFSetField (out, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT);
TIFFSetField (out, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_RGB); TIFFSetField (out, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_RGB);
TIFFSetField (out, TIFFTAG_COMPRESSION, uncompressed ? COMPRESSION_NONE : COMPRESSION_LZW); TIFFSetField (out, TIFFTAG_COMPRESSION, uncompressed ? COMPRESSION_NONE : COMPRESSION_DEFLATE);
if (!uncompressed) if (!uncompressed)
TIFFSetField (out, TIFFTAG_PREDICTOR, PREDICTOR_HORIZONTAL); TIFFSetField (out, TIFFTAG_PREDICTOR, PREDICTOR_NONE);
if (profileData) if (profileData)
TIFFSetField (out, TIFFTAG_ICCPROFILE, profileLength, profileData); TIFFSetField (out, TIFFTAG_ICCPROFILE, profileLength, profileData);