mirador icon indicating copy to clipboard operation
mirador copied to clipboard

Implementation of fetchInfoResponse is not complient with iiif

Open mexthecat opened this issue 2 years ago • 0 comments

Like @stephenwf mentioned in https://github.com/ProjectMirador/mirador/issues/3552#issuecomment-1112335225


I think the code mentioned:

/**
 * fetchInfoResponse - action creator
 *
 * @param  {String} infoId
 * @memberof ActionCreators
 */
export function fetchInfoResponse({ imageId, imageResource, windowId }) {
  const imageService = imageResource && imageResource.getServices()[0];
  const infoId = (imageId || imageService.id);
  return requestInfoResponse(infoId, imageService, windowId);
}

is still prone to bugs. A completely valid Image resource for example, could break:

{
  "id": "https://example.org/path/image.jpg",
  "type": "Image",
  "service": [
     { "type": "Service", "profile": "my-dimensions", " .... " },
     { "type": "ImageService3", "profile": "level2", "...." }
  ]
}

As the code is not looking for an image service from the list, just the first service:

imageResource.getServices()[0]

I think Manifesto just surfaced the bug.


mexthecat avatar Apr 29 '22 03:04 mexthecat