Merge pull request #4189 from sjbronner/main

Fix grey result of indexed PNG in pdfrenderer.
This commit is contained in:
Egor Pugin 2024-02-12 16:15:20 +03:00 committed by GitHub
commit becd395490
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -674,14 +674,7 @@ bool TessPDFRenderer::imageToPDFObj(Pix *pix, const char *filename, long int obj
} }
L_Compressed_Data *cid = nullptr; L_Compressed_Data *cid = nullptr;
auto sad = l_generateCIDataForPdf(filename, pix, jpg_quality, &cid);
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);
}
if (sad || !cid) { if (sad || !cid) {
l_CIDataDestroy(&cid); l_CIDataDestroy(&cid);