-
I'm trying to load the full image service definition for a canvas' image into the vault, but so far was unsuccessful: function loadFullService(imgService: ImageService): Promise<ImageService | undefined> {
const serviceUrl = `${imgService.id ?? imgService['@id']}/info.json`;
return vault.load<ImageService>(serviceUrl);
} The outcome of this function differs between IIIF2 and IIIF3 services: For IIIF2 services, I always get back For IIIF3 services, it crashes at this position:
I tested it with https://iiif.io/api/image/3.0/example/reference/918ecd18c2592080851777620de9bcb5-gottingen/info.json. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Image API resources are not currently able to be loaded into Vault (although that could be something to explore). There is another library here: https://github.com/atlas-viewer/iiif-image-api that I've been using to explore what might be possible, and what problems we could solve. One of the main features is reducing import { ImageServiceLoader } from ['@atlas-viewer/iiif-image-api'](https://www.npmjs.com/package/@atlas-viewer/iiif-image-api);
const loader = new ImageServiceLoader();
loader.loadService({ id: '[...]/image-1/info.json '}); // Fetched remotely
loader.loadService({ id: '[...]/image-2/info.json '}); // Fetched remotely + predicts
loader.loadService({ id: '[...]/image-3/info.json '}); // Skips fetching
// ...
loader.loadService({ id: '[...]/image-n/info.json '}); // Skips fetching And then trying to put together a set of utilities for feature-detection + safe construction of image requests. import { supports } from '@atlas-viewer/iiif-image-api';
const [doesSupport, failedReason] = supports(myInfoJson, { extraQualities: ['default', 'grey'] }) (some more in: https://github.com/atlas-viewer/iiif-image-api/blob/main/__tests__/supports.test.ts) finally some more server-y code ported from C# for parsing IIIF image URL requests: https://github.com/atlas-viewer/iiif-image-api/blob/main/__tests__/parameters.test.ts |
Beta Was this translation helpful? Give feedback.
Image API resources are not currently able to be loaded into Vault (although that could be something to explore).
There is another library here: https://github.com/atlas-viewer/iiif-image-api that I've been using to explore what might be possible, and what problems we could solve.
One of the main features is reducing
info.json
requests where possible in viewers. This avoid the need to load and store many hundreds of image descriptions.