-
Notifications
You must be signed in to change notification settings - Fork 9.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not recognise file with transparent background #369
Comments
If you think that's exciting, check out the PDF output. Looks like we have at least one bug on our hands. Thanks for reporting this. |
This will take care of the PDF portion (so that we blend with white instead of just stripping the entire alpha channel). The recognition part is probably a discussion with Ray. Reading the source code, it is not clear to me why we don't recognize. Alpha looks like it is treated like any other color channel as opposed to something special. --- tesseract/api/pdfrenderer.cpp 2016-07-06 13:19:57.000000000 -0700
+++ tesseract/api/pdfrenderer.cpp 2016-07-20 16:23:13.000000000 -0700
@@ -690,8 +690,9 @@
int format, sad;
findFileFormat(filename, &format);
if (pixGetSpp(pix) == 4 && format == IFF_PNG) {
- pixSetSpp(pix, 3);
- sad = pixGenerateCIData(pix, L_FLATE_ENCODE, 0, 0, &cid);
+ Pix *p1 = pixAlphaBlendUniform(pix, 0xffffff00);
+ sad = pixGenerateCIData(p1, L_FLATE_ENCODE, 0, 0, &cid);
+ pixDestroy(&p1);
} else {
sad = l_generateCIDataForPdf(filename, pix, kJpegQuality, &cid);
} |
Hi,
I just found out it can not read from a file having transparent background!
See yourself!
When I use the png with transparent background, it fails.
Using the same JPG file, it runs beautifully.
The text was updated successfully, but these errors were encountered: