diff --git a/tesseract4android/src/main/cpp/leptonica/CMakeLists.txt b/tesseract4android/src/main/cpp/leptonica/CMakeLists.txt index 9d7f22a8..d937baa9 100644 --- a/tesseract4android/src/main/cpp/leptonica/CMakeLists.txt +++ b/tesseract4android/src/main/cpp/leptonica/CMakeLists.txt @@ -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 diff --git a/tesseract4android/src/main/cpp/tesseract/src/src/api/pdfrenderer.cpp b/tesseract4android/src/main/cpp/tesseract/src/src/api/pdfrenderer.cpp index 4dc224a1..2ee85fed 100644 --- a/tesseract4android/src/main/cpp/tesseract/src/src/api/pdfrenderer.cpp +++ b/tesseract4android/src/main/cpp/tesseract/src/src/api/pdfrenderer.cpp @@ -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);