tiff2pdf: fix "raw" copy of Deflate streams

The Predictor parametter was not copied from the source tiff to the PDF.
fixes #48 / http://bugzilla.maptools.org/show_bug.cgi?id=2442
This commit is contained in:
Thomas Bernard 2020-03-27 00:31:59 +01:00
parent f1e9078f92
commit 4efb92d1c9
No known key found for this signature in database
GPG Key ID: 0FF11B67A5C0863C

View File

@ -232,7 +232,7 @@ typedef struct {
t2p_compress_t pdf_defaultcompression;
uint16 pdf_defaultcompressionquality;
t2p_compress_t pdf_compression;
uint16 pdf_compressionquality;
uint16 pdf_compressionquality; /* for deflate : 100 * zipquality + predictor */
uint16 pdf_nopassthrough;
t2p_transcode_t pdf_transcode;
t2p_sample_t pdf_sample;
@ -1822,8 +1822,12 @@ void t2p_read_tiff_data(T2P* t2p, TIFF* input){
if(t2p->tiff_compression== COMPRESSION_ADOBE_DEFLATE
|| t2p->tiff_compression==COMPRESSION_DEFLATE){
if(TIFFIsTiled(input) || (TIFFNumberOfStrips(input)==1) ){
uint16 predictor;
t2p->pdf_transcode = T2P_TRANSCODE_RAW;
t2p->pdf_compression=T2P_COMPRESS_ZIP;
TIFFGetField(input, TIFFTAG_PREDICTOR, &predictor);
t2p->pdf_compressionquality = predictor;
/* TIFFTAG_ZIPQUALITY is always Z_DEFAULT_COMPRESSION on reading */
}
}
#endif