Skip to content

Commit

Permalink
Revert "Always use L_FLATE_ENCODE in PdfRenderer (fixes #31)"
Browse files Browse the repository at this point in the history
This reverts commit 1181cc0.
  • Loading branch information
Robyer committed Mar 4, 2021
1 parent 339a4a9 commit 3975aa6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion tesseract4android/src/main/cpp/leptonica/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ add_definitions(-DANDROID_BUILD)
add_definitions(-DHAVE_LIBJPEG=1)
add_definitions(-DHAVE_LIBPNG=1)
add_definitions(-DHAVE_LIBZ=1)
# TODO: Enable this when we use minSdkVersion 23 or higher and remove workaround in pdfrenderer.cpp
# TODO: Enable this when we use minSdkVersion 23 or higher
#add_definitions(-DHAVE_FMEMOPEN=1)

# Ignore some warnings during build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -675,14 +675,8 @@ bool TessPDFRenderer::imageToPDFObj(Pix *pix,

L_Compressed_Data *cid = nullptr;

#ifdef __ANDROID__ // Remove this when we use minSdkVersion 23 or higher
bool flateEncode = true;
#else
bool flateEncode = pixGetInputFormat(pix) == IFF_PNG;
#endif

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

0 comments on commit 3975aa6

Please sign in to comment.