-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Don't utilize Leptonica debug parameters or functions #557
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
Comments
I am fairly sure that pixGenHalftoneMask() (and the wrapper pixGenerateHalftoneMask()) are the only leptonica functions in tesseract that have a debug argument. It should be OK in the new tesseract (4.00) to use pixGenerateHalftoneMask() with NULL for the debug pixa. It would also be nice at the same time for the debug calls to the deprecated functions pixDisplayWrite() and pixDisplayWriteFormat() to be removed, because there is no reason that tesseract needs to generate these debug images. |
I believe that Ray is removing all use of temp files due to pixDisplayWrite() in tesseract. |
Fixed in commit a1c22fb. |
@theraysmith
These two Leptonica calls have optional debugging parameters.
pixGenerateHalftoneMask
pixGenHalftoneMask
They are found in imagefind.cpp in code and comments, to support an optional
parameter called textord_tabfind_show_images
https://github.com/tesseract-ocr/tesseract/blob/master/textord/imagefind.cpp#L86
In general, the debug paths in Leptonica are not great from security perspective
and setting that debug parameter to null or false is recommended. If possible
I encourage removing the the textord_tabfind_show_images feature entirely.
In addition, there is significant use of pixDisplayWrite for debugging purposes.
This is deprecated and also a security headache, and I encourage removing
all calls to this function.
It is possible that this list is not exhaustive but it probably is. The rule of thumb
is try to avoid debug-specific Leptonica code paths wherever possible in release builds.
The text was updated successfully, but these errors were encountered: