Skip to content
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

[app][fix] compare vs page _type #17

Closed
wants to merge 1 commit into from
Closed

[app][fix] compare vs page _type #17

wants to merge 1 commit into from

Conversation

M3ssman
Copy link

@M3ssman M3ssman commented Jul 22, 2021

Fix failing build by using information from page rather than from alto

@@ -122,7 +122,7 @@ def __init__(self):
def set_alto_tag_from_type(self, reg_alto, reg_page):
typ = reg_page.get_type() if hasattr(reg_page, 'get_type') else None
if typ:
if hasattr(reg_alto, 'TYPE'):
if hasattr(reg_page, 'type_'):
Copy link
Member

@kba kba Aug 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check is there to prevent setting TYPE for an ALTO element that doesn't support it. That's most types, only ComposedBlock and Illustration allow it. Your check verifies that the source region in PAGE has a type_ attribute - which they all do (at least at this point in the code), so it fixes the issue for your data but produces invalid ALTO.

Have a look at #18 whether that fixes your problem as well. Feel free to share test data / conditions so we can make a regression test for this.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest, my intention was just to fix the red badge on the project's page.

The whitelist approach fits far better in this context, I'm fine with it

@M3ssman M3ssman closed this Aug 2, 2021
@M3ssman M3ssman deleted the fix/fix-test-alto-tag branch August 2, 2021 18:14
kba added a commit that referenced this pull request Aug 3, 2021
LayoutTagManager: Use explicit whitelist of TYPEd ALTO regions, #17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants