Skip to content

Commit

Permalink
Issue 4lex4#164 - Fix TIFF saving when JPEG and posterized
Browse files Browse the repository at this point in the history
  • Loading branch information
hfiguiere committed Jan 6, 2021
1 parent 3d1e74e commit f6ae162
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/TiffWriter.cpp
Expand Up @@ -222,8 +222,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()));
}
Expand Down

0 comments on commit f6ae162

Please sign in to comment.