diff --git a/com.github._4lex4.ScanTailor-Advanced.yaml b/com.github._4lex4.ScanTailor-Advanced.yaml index 7c89bec..7ee1b1d 100644 --- a/com.github._4lex4.ScanTailor-Advanced.yaml +++ b/com.github._4lex4.ScanTailor-Advanced.yaml @@ -44,6 +44,8 @@ modules: path: com.github._4lex4.ScanTailor-Advanced.metainfo.xml.in - type: patch path: scantailor-qt5.15.patch + - type: patch + path: scantailor-tiffsave-fix.patch buildsystem: cmake-ninja builddir: true config-opts: diff --git a/scantailor-tiffsave-fix.patch b/scantailor-tiffsave-fix.patch new file mode 100644 index 0000000..a8dde17 --- /dev/null +++ b/scantailor-tiffsave-fix.patch @@ -0,0 +1,23 @@ +commit 5ee818e03f2201e34e3707151133dee3f2e43de9 +Author: Hubert Figuière +Date: Tue Jan 5 15:23:48 2021 -0500 + + Issue #164 - Fix TIFF saving when JPEG and posterized + +diff --git a/src/core/TiffWriter.cpp b/src/core/TiffWriter.cpp +index f68b021..385c4ec 100644 +--- a/src/core/TiffWriter.cpp ++++ b/src/core/TiffWriter.cpp +@@ -225,8 +225,10 @@ bool TiffWriter::writeBitonalOrIndexed8Image(const TiffHandle& tif, const QImage + } + + if (image.format() == QImage::Format_Indexed8) { +- TIFFSetField(tif.handle(), TIFFTAG_COMPRESSION, +- uint16(ApplicationSettings::getInstance().getTiffColorCompression())); ++ uint16 compress = (photometric == PHOTOMETRIC_PALETTE) ? ++ COMPRESSION_LZW : ++ uint16(ApplicationSettings::getInstance().getTiffColorCompression()); ++ TIFFSetField(tif.handle(), TIFFTAG_COMPRESSION, compress); + } else { + TIFFSetField(tif.handle(), TIFFTAG_COMPRESSION, uint16(ApplicationSettings::getInstance().getTiffBwCompression())); + }