From 1c409649c3eb08d7f878e0ae7399f62319964c80 Mon Sep 17 00:00:00 2001 From: Michal Thoma Date: Sat, 4 Sep 2010 15:28:10 +0200 Subject: [PATCH] Using ZIP compression for TIFF files & fix digikam compatibility (fixes issue 107 and issue 108) --- rtengine/imageio.cc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/rtengine/imageio.cc b/rtengine/imageio.cc index 615e5a11e..93e2eebed 100644 --- a/rtengine/imageio.cc +++ b/rtengine/imageio.cc @@ -690,21 +690,22 @@ 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_IMAGELENGTH, height); TIFFSetField (out, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT); TIFFSetField (out, TIFFTAG_SAMPLESPERPIXEL, 3); + TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, height); TIFFSetField (out, TIFFTAG_BITSPERSAMPLE, bps); TIFFSetField (out, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); TIFFSetField (out, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT); TIFFSetField (out, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_RGB); - TIFFSetField (out, TIFFTAG_COMPRESSION, uncompressed ? COMPRESSION_NONE : COMPRESSION_LZW); - if (!uncompressed) - TIFFSetField (out, TIFFTAG_PREDICTOR, PREDICTOR_HORIZONTAL); - - if (profileData) - TIFFSetField (out, TIFFTAG_ICCPROFILE, profileLength, profileData); + TIFFSetField (out, TIFFTAG_COMPRESSION, uncompressed ? COMPRESSION_NONE : COMPRESSION_DEFLATE); + if (!uncompressed) + TIFFSetField (out, TIFFTAG_PREDICTOR, PREDICTOR_NONE); + + if (profileData) + TIFFSetField (out, TIFFTAG_ICCPROFILE, profileLength, profileData); for (int row = 0; row < height; row++) { getScanline (row, linebuffer, bps);