Skip to content

Handle images with invalid dimensions

https://redmine.teklia.com/issues/9915

Sentry Issue: ARKINDEX-FRONTEND-BYH

Error: An image with valid dimensions is required.
  at C (/arkindex/1.7.1/arkindex-1.7.1.js:1:46918)
  at boxCoords (/arkindex/1.7.1/arkindex-1.7.1.js:1:465659)
  at run (/arkindex/1.7.1/arkindex-vendors-1.7.1.js:1:75618)
  at get value (/arkindex/1.7.1/arkindex-vendors-1.7.1.js:1:83853)
  at get (/arkindex/1.7.1/arkindex-vendors-1.7.1.js:1:103195)
...
(45 additional frame(s) were not displayed)

We cannot display an image at all when either its width or its height are 0, so the InteractiveImage element should not be displayed in the Element.vue view. In its place, an error notification should explain that the image has invalid dimensions and cannot be displayed. The notification can include a link to zone.image.url, similarly to the existing image error notification that can be shown on the ImageLayer.

The View source image link should also be hidden since we cannot build a valid IIIF URI for the image, but the List elements on this image link should still work.

In the ImageElements.vue view, the image thumbnail should not be displayed when the image dimensions are invalid, and the URL should be zone.image.url directly instead of using the iiifUri helper. This will help with troubleshooting.