summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-06-08 12:30:08 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2016-06-15 08:16:52 +0000
commit4e25236729caf1947ddcdfb51f17252ff863d9bf (patch)
treea20ec1f1fde1513bdb69c4c97c2b7d4adf2c40a5 /src
parent3c08a8365a7dede06620819a859f8ed93792d4e6 (diff)
downloadqtimageformats-4e25236729caf1947ddcdfb51f17252ff863d9bf.tar.gz
Use LZW compression on 1- and 8-bit formats
The documentation says we use LZW, and LZW both works and produces smaller results, so it would make sense to follow our documentation. This also fixes a problem with some readers having trouble with the CCITTRLE compressions. Task-number: QTBUG-53774 Change-Id: Ie2d179279a4ce65d8578c037ad59cc37ca854825 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/imageformats/tiff/qtiffhandler.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/imageformats/tiff/qtiffhandler.cpp b/src/plugins/imageformats/tiff/qtiffhandler.cpp
index f72c2a0..6fcf2a7 100644
--- a/src/plugins/imageformats/tiff/qtiffhandler.cpp
+++ b/src/plugins/imageformats/tiff/qtiffhandler.cpp
@@ -541,7 +541,7 @@ bool QTiffHandler::write(const QImage &image)
if (image.colorTable().at(0) == 0xffffffff)
photometric = PHOTOMETRIC_MINISWHITE;
if (!TIFFSetField(tiff, TIFFTAG_PHOTOMETRIC, photometric)
- || !TIFFSetField(tiff, TIFFTAG_COMPRESSION, compression == NoCompression ? COMPRESSION_NONE : COMPRESSION_CCITTRLE)
+ || !TIFFSetField(tiff, TIFFTAG_COMPRESSION, compression == NoCompression ? COMPRESSION_NONE : COMPRESSION_LZW)
|| !TIFFSetField(tiff, TIFFTAG_BITSPERSAMPLE, 1)) {
TIFFClose(tiff);
return false;
@@ -576,14 +576,14 @@ bool QTiffHandler::write(const QImage &image)
if (colorTable.at(0) == 0xffffffff)
photometric = PHOTOMETRIC_MINISWHITE;
if (!TIFFSetField(tiff, TIFFTAG_PHOTOMETRIC, photometric)
- || !TIFFSetField(tiff, TIFFTAG_COMPRESSION, compression == NoCompression ? COMPRESSION_NONE : COMPRESSION_PACKBITS)
+ || !TIFFSetField(tiff, TIFFTAG_COMPRESSION, compression == NoCompression ? COMPRESSION_NONE : COMPRESSION_LZW)
|| !TIFFSetField(tiff, TIFFTAG_BITSPERSAMPLE, 8)) {
TIFFClose(tiff);
return false;
}
} else {
if (!TIFFSetField(tiff, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_PALETTE)
- || !TIFFSetField(tiff, TIFFTAG_COMPRESSION, compression == NoCompression ? COMPRESSION_NONE : COMPRESSION_PACKBITS)
+ || !TIFFSetField(tiff, TIFFTAG_COMPRESSION, compression == NoCompression ? COMPRESSION_NONE : COMPRESSION_LZW)
|| !TIFFSetField(tiff, TIFFTAG_BITSPERSAMPLE, 8)) {
TIFFClose(tiff);
return false;