hnesk/browse-ocrd

AlternativeImage selection glitch

Opened this issue · 0 comments

Since the recent changes regarding image selection, I am getting the following:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/ocrd_browser/model/page.py", line 102, in get_image
    page_image, page_coords, page_image_info = ws.image_from_page(self.page, self.id, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/ocrd/workspace.py", line 730, in image_from_page
    filename, page_id))
Exception: Found no AlternativeImage that satisfies all requirements filename="." in page "PHYS_0001"

This goes away when I explicitly select an image version in the feature configurator. So the problem is the initialization.

I believe the cause is in b19ae33, where view.page.ImageVersion.list_from_page will serialize an uninitialized pathlib.Path (which happens to be . as str) instead of the empty string or None (which would have worked with the existing code in ImageVersionSelector and ViewPage).