Skip to content

Commit 95ec067

Browse files
hfiguiereUnrud
authored andcommitted
Include patch for upstream 4lex4/scantailor-advanced#166
1 parent 1c9b7ee commit 95ec067

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

com.github._4lex4.ScanTailor-Advanced.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ modules:
4444
path: com.github._4lex4.ScanTailor-Advanced.metainfo.xml.in
4545
- type: patch
4646
path: scantailor-qt5.15.patch
47+
- type: patch
48+
path: scantailor-tiffsave-fix.patch
4749
buildsystem: cmake-ninja
4850
builddir: true
4951
config-opts:

scantailor-tiffsave-fix.patch

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
commit 5ee818e03f2201e34e3707151133dee3f2e43de9
2+
Author: Hubert Figuière <[email protected]>
3+
Date: Tue Jan 5 15:23:48 2021 -0500
4+
5+
Issue #164 - Fix TIFF saving when JPEG and posterized
6+
7+
diff --git a/src/core/TiffWriter.cpp b/src/core/TiffWriter.cpp
8+
index f68b021..385c4ec 100644
9+
--- a/src/core/TiffWriter.cpp
10+
+++ b/src/core/TiffWriter.cpp
11+
@@ -225,8 +225,10 @@ bool TiffWriter::writeBitonalOrIndexed8Image(const TiffHandle& tif, const QImage
12+
}
13+
14+
if (image.format() == QImage::Format_Indexed8) {
15+
- TIFFSetField(tif.handle(), TIFFTAG_COMPRESSION,
16+
- uint16(ApplicationSettings::getInstance().getTiffColorCompression()));
17+
+ uint16 compress = (photometric == PHOTOMETRIC_PALETTE) ?
18+
+ COMPRESSION_LZW :
19+
+ uint16(ApplicationSettings::getInstance().getTiffColorCompression());
20+
+ TIFFSetField(tif.handle(), TIFFTAG_COMPRESSION, compress);
21+
} else {
22+
TIFFSetField(tif.handle(), TIFFTAG_COMPRESSION, uint16(ApplicationSettings::getInstance().getTiffBwCompression()));
23+
}

0 commit comments

Comments
 (0)