use pdf L_FLATE_ENCODE only for png input; fixes #1961

This commit is contained in:
zdenop 2018-10-07 20:57:19 +02:00
parent 5cf5c80ba1
commit f794571195

View File

@ -716,7 +716,8 @@ bool TessPDFRenderer::imageToPDFObj(Pix *pix,
const int kJpegQuality = jpg_quality;
int format, sad;
sad = pixGenerateCIData(pix, L_FLATE_ENCODE, 0, 0, &cid);
if (pixGetInputFormat(pix) == IFF_PNG)
sad = pixGenerateCIData(pix, L_FLATE_ENCODE, 0, 0, &cid);
if (!cid) {
sad = l_generateCIDataForPdf(filename, pix, kJpegQuality, &cid);
}