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

document.page_for_id: catch empty imageFilename case #25

Merged
merged 4 commits into from
Nov 5, 2020

Conversation

bertsky
Copy link
Contributor

@bertsky bertsky commented Nov 2, 2020

Fixes #18 – previous fix was only partially related. (I'll also raise a true exception in core in workspace.image_from_page here, but we'll need this workaround anyway.)

Use-case is (workspaces with results from) ocrd-fileformat-transform -P "alto page" which does not ensure @imageFilename.

@bertsky
Copy link
Contributor Author

bertsky commented Nov 3, 2020

added some more:

ocrd_browser_htmlview

if mime == 'text/html':
ext = '.html'
else:
ext = MIME_TO_EXT.get(mime, '.???')
Copy link
Owner

Choose a reason for hiding this comment

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

Or maybe we should add "text/html" to ocrd_utils.constants.MIME_TO_EXT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Or maybe we should add "text/html" to ocrd_utils.constants.MIME_TO_EXT?

Thought about that – not sure TBH. (Might have implications elsewhere.) @kba?

@hnesk hnesk merged commit 650adcf into hnesk:master Nov 5, 2020
@hnesk
Copy link
Owner

hnesk commented Nov 5, 2020

Thanks, @bertsky !

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.

other MIME types
2 participants