rmtheis / tess-two

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

read Jpeg and PNG produce wrong alpha in 32bpp pix #264

Closed alexcohn closed 5 years ago

alexcohn commented 5 years ago

The tests ReadFileTest.testReadFile_jpg() and ReadFileTest.testReadFile_png() fail for me, with an arm64 device.

See https://github.com/DanBloomberg/leptonica/issues/442. An easy fix inside leptronica can be pulled, but maybe I am missing something and these tests pass for you?

alexcohn commented 5 years ago

probably this happens for me because I used a different version of readfile.cpp.

alexcohn commented 5 years ago

The problem has been discussed before. The current version produces Pix with bpp8 from ReadFIle.readBitmap(), and loosing alpha information is only a small issue; RGB colors get distorted, too (for grayscale bitmaps, the result may be OK).

rmtheis commented 5 years ago

Thank you for looking into and fixing this issue. This one was a longstanding issue.

alexcohn commented 5 years ago

I have fixed this and similar WriteFile tests in my fork, which uses Tesseract 4.0. Should I create a special Pull Request for these changes, or maybe it would be wise to move the whole project to Tesseract 4.0 ?