Skip to content

Commit

Permalink
Merge pull request #4189 from sjbronner/main
Browse files Browse the repository at this point in the history
Fix grey result of indexed PNG in pdfrenderer.
  • Loading branch information
egorpugin committed Feb 12, 2024
2 parents a7f860a + 304014f commit becd395
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/api/pdfrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -674,14 +674,7 @@ bool TessPDFRenderer::imageToPDFObj(Pix *pix, const char *filename, long int obj
}

L_Compressed_Data *cid = nullptr;

int sad = 0;
if (pixGetInputFormat(pix) == IFF_PNG) {
sad = pixGenerateCIData(pix, L_FLATE_ENCODE, 0, 0, &cid);
}
if (!cid) {
sad = l_generateCIDataForPdf(filename, pix, jpg_quality, &cid);
}
auto sad = l_generateCIDataForPdf(filename, pix, jpg_quality, &cid);

if (sad || !cid) {
l_CIDataDestroy(&cid);
Expand Down

0 comments on commit becd395

Please sign in to comment.