-
Notifications
You must be signed in to change notification settings - Fork 29
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
Invalid resolution 0 dpi warning in stderr #6
Comments
Based on discussion from tesseract-ocr/tesseract#1702, I added a new set_source_resolution, could you give that a try? |
Thank you, didn't notice this option could be a solution. I'm wondering, would this overwrite the resolution in case the image resolution is known? Because I can imagine this could then cause undesirable behavior if setting the resolution to 70 for all images, even though the resolution might be known for some. |
Yeah, good point. Added |
Using Thanks for the rapid addition! |
I just noticed an interesting edge case. It appears that some images have a DPI of 1 defined (and yes, that's incorrect).
It's interesting, because this isn't covered by the In case you're wondering. I'm scanning all images, stickers, videos and such from Telegram groups (for smart spam prevention). As you can probably imagine, I'm receiving a wide spectrum of images, image types, sizes and formats. That's why I'm seeing these weird edge cases. |
That's interesting, i wonder what's the range of dpi that tesseract would consider invalid. If it can't work with 1 dpi images, then it makes sense to add it to the fallback method. |
I didn't notice the fallback method is only part of this library, and thought it was provided by tesseract. I'll try and search for the range and update the function. |
The original warning appears to be coming from the following section, and changes the DPI if the detected DPI is outside a specified range: The allowed DPI range is defined here: Note that it only automatically changes the used DPI to the lowest in the allowed range if the user didn't specify a DPI himself. And it does not change the DPI if the user did explicitly set it to something outside the allowed range. I'll look into improving this crate for these findings now. |
When using this crate, I occasionally receive a warning in
stderr
when opening/reading an image. I assume this is produced by the leptess/tesseract library.This is what it looks like:
It does not look like it is possible to disable this behavior through the current API. Are there any plans to implement a toggle for this?
The text was updated successfully, but these errors were encountered: