rmtheis / tess-two

Fork of Tesseract Tools for Android
Apache License 2.0
3.76k stars 1.38k forks source link

Failed to read bitmap #199

Closed yxwandroid closed 7 years ago

yxwandroid commented 7 years ago

Summary: How to deal with Failed to read bitmap

Steps to reproduce the issue:

baseApi.init(TESSBASE_PATH, DEFAULT_LANGUAGE); baseApi.setImage(bmp); Expected result: Caused by: java.lang.RuntimeException: Failed to read bitmap Actual result:

Tess-two version:

6.2.0

Android version:

Phone/device model:

Phone/device architecture (armeabi, armeabi-v7a, x86, mips, arm64-v8a, x86_64, mips64):

rmtheis commented 7 years ago

Can't say without more information. The error message is coming from here, meaning that it failed in the native code. Maybe the bitmap you're passing in is too big?

rmtheis commented 7 years ago

You should also get another message printed to the log such as Failed to read pix from bitmap.

yxwandroid commented 7 years ago

I Found the reason

Bitmap config must be ARGB_8888