Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

hocr: only add space if boxwidth is positive #1446

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pajowu
Copy link

@pajowu pajowu commented Dec 11, 2024

If the HOCR contains overlapping words in the same line or the words are not ordered in reading-direction, space_box.width might be negative. This leads to more issues with the calculation of font width etc, producing text boxes that are way larger than the actual bbox set within the hocr-file

Copy link

codecov bot commented Dec 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.20%. Comparing base (02d85ff) to head (74253e5).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1446      +/-   ##
==========================================
+ Coverage   90.18%   90.20%   +0.01%     
==========================================
  Files          95       95              
  Lines        7073     7073              
  Branches      722      722              
==========================================
+ Hits         6379     6380       +1     
  Misses        491      491              
+ Partials      203      202       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jbarlow83
Copy link
Collaborator

This is great work - I just want to take some time to review it.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants