forked from flathub/com.github._4lex4.ScanTailor-Advanced
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include patch for upstream 4lex4/scantailor-advanced#166
- Loading branch information
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
commit 5ee818e03f2201e34e3707151133dee3f2e43de9 | ||
Author: Hubert Figuière <[email protected]> | ||
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())); | ||
} |