-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Currently there is no Annotation builder, you have to provide the JSON for each annotation individually.
I don't think a builder in the style of the Canvas or Manifest builders would for this case - instead maybe a set of presets.
Annotation.imageWithService(
'https://example.org/image.jpg',
{ service: 'https://example.org/image.jpg/info.json' }
);What would be nice is to include some of the analysis work done in Manifest editor. Where you can provide just an Image URL or Image service and it will figure out what the ID and inline service block should look like. This would be async and would be opt-in (with an await).
For example, the following URL:
https://iiif.wellcomecollection.org/image/b18035723_0004.JP2/full/732,1024/0/default.jpg
Might return:
{
"id": "https://example.org/canvas/354e4ae3-d4bc-4785-b567-77dfd65bf9f8/painting",
"type": "Annotation",
"motivation": "painting",
"target": "https://example.org/canvas/354e4ae3-d4bc-4785-b567-77dfd65bf9f8",
"body": {
"id": "https://example.org/image/4d0f3a1d-1170-42ed-81cd-49099be604f3",
"type": "Image",
"format": "image/jpg",
"height": 3372,
"width": 2411,
"service": [
{
"@context": "http://iiif.io/api/image/2/context.json",
"@id": "https://iiif.wellcomecollection.org/image/b18035723_0004.JP2",
"protocol": "http://iiif.io/api/image",
"width": 2411,
"height": 3372,
"tiles": [
{
"width": 256,
"height": 256,
"scaleFactors": [
1,
2,
4,
8,
16
]
}
],
"sizes": [
{
"width": 715,
"height": 1000
},
{
"width": 286,
"height": 400
},
{
"width": 143,
"height": 200
},
{
"width": 72,
"height": 100
}
],
"profile": [
"http://iiif.io/api/image/2/level1.json",
{
"formats": [
"jpg"
],
"qualities": [
"native",
"color",
"gray"
],
"supports": [
"regionByPct",
"sizeByForcedWh",
"sizeByWh",
"sizeAboveFull",
"rotationBy90s",
"mirroring",
"gray"
]
}
],
"type": "ImageService"
}
]
}
}Extra configuration could limit how much of the resolved service is inlined.
Other helpers for common types of annotations could then be created.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request