Skip to content

Commit 6ac57b1

Browse files
committed
Include patch for upstream 4lex4/scantailor-advanced#166
1 parent 85b0fb6 commit 6ac57b1

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-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
config-opts:
4951
- -DCMAKE_BUILD_TYPE=RelWithDebInfo

scantailor-tiffsave-fix.patch

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
From f6ae1624bf2cb55d1bd10a14d6215c2414633e32 Mon Sep 17 00:00:00 2001
2+
From: =?UTF-8?q?Hubert=20Figui=C3=A8re?= <[email protected]>
3+
Date: Tue, 5 Jan 2021 15:23:48 -0500
4+
Subject: [PATCH] Issue #164 - Fix TIFF saving when JPEG and posterized
5+
6+
---
7+
src/core/TiffWriter.cpp | 6 ++++--
8+
1 file changed, 4 insertions(+), 2 deletions(-)
9+
10+
diff --git a/src/core/TiffWriter.cpp b/src/core/TiffWriter.cpp
11+
index 0713e05ad..f84be661c 100644
12+
--- a/src/core/TiffWriter.cpp
13+
+++ b/src/core/TiffWriter.cpp
14+
@@ -222,8 +222,10 @@ bool TiffWriter::writeBitonalOrIndexed8Image(const TiffHandle& tif, const QImage
15+
}
16+
17+
if (image.format() == QImage::Format_Indexed8) {
18+
- TIFFSetField(tif.handle(), TIFFTAG_COMPRESSION,
19+
- uint16(ApplicationSettings::getInstance().getTiffColorCompression()));
20+
+ uint16 compress = (photometric == PHOTOMETRIC_PALETTE) ?
21+
+ COMPRESSION_LZW :
22+
+ uint16(ApplicationSettings::getInstance().getTiffColorCompression());
23+
+ TIFFSetField(tif.handle(), TIFFTAG_COMPRESSION, compress);
24+
} else {
25+
TIFFSetField(tif.handle(), TIFFTAG_COMPRESSION, uint16(ApplicationSettings::getInstance().getTiffBwCompression()));
26+
}

0 commit comments

Comments
 (0)