Skip to content

Commit

Permalink
use pdf L_FLATE_ENCODE only for png input; fixes #1961
Browse files Browse the repository at this point in the history
  • Loading branch information
zdenop committed Oct 7, 2018
1 parent 5cf5c80 commit f794571
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/api/pdfrenderer.cpp
Expand Up @@ -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);
}
Expand Down

0 comments on commit f794571

Please sign in to comment.