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

previewer not showing images (change in image key format) #43

Open
dfdan opened this issue Jun 16, 2021 · 0 comments
Open

previewer not showing images (change in image key format) #43

dfdan opened this issue Jun 16, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@dfdan
Copy link
Member

dfdan commented Jun 16, 2021

Package version (if known): v1.1.1

Describe the bug

iiif_image previewer can not show images due to incorrect image keys from utils.py/iiif_image_key()

Steps to Reproduce

(tested on RDM 4)

  1. add to invenio.cfg to enable IIIF Image service -
IIIF_IMAGE_OPENER_HANDLER = "invenio_rdm_records.resources.iiif:image_opener"
IIIF_API_DECORATOR_HANDLER = None
PREVIEWER_PREFERENCE=['iiif_image']; 
IIIF_PREVIEW_TEMPLATE = 'invenio_app_rdm/records/iiif_preview.html'
  1. At this point, manually constructed image URLs will work, however...
  2. preview a record with attached image
  3. error thrown in previewer iframe
  ...
  File "/home/blip/npg0/invenio-iiif/invenio_iiif/utils.py", line 29, in iiif_image_key
    bucket_id = obj.get('bucket')
AttributeError: 'FileItem' object has no attribute 'get'

As this function is now being passed an unexpected datatype.

Expected behavior

image should be loaded in previewer.

Additional context

Although this function is only used internally, it would be useful for things (eg an IIIF presentation seralizer) to be able to get the keys / image API URLs from invenio-iiif.

I will link a quick local fix I've implemented in a moment, but @lnielsen / @ppanero can we talk about how I could implement a more general fix so invenio-iiif can get the key from the records resources without making invenio-iiif dependent on rdm-records?

@dfdan dfdan added the bug Something isn't working label Jun 16, 2021
dfdan added a commit to data-futures/invenio-iiif that referenced this issue Jun 16, 2021
@lnielsen lnielsen added this to Triage in InvenioRDM June Team QA via automation Jun 23, 2021
@lnielsen lnielsen moved this from Triage to Blocked in InvenioRDM June Team QA Jun 23, 2021
@lnielsen lnielsen removed this from Blocked in InvenioRDM June Team QA Jul 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant