Adaptation for images in annotations
NB The issue below is about printing images associated to annotations on the main canvas, over the video. The target area used is the region of the canvas selected by the MediaFragment in the annotation target. This behaviour is copied from the mirador "fork" we used.
However, IIIF Presentation API specify that only Annotations from the items
property of the Manifest can have the painting
motivation and so be drawn on the canvas, and its unclear if our user-added annotations, which will be stored outside the manifest, can have the painting motivation (currently we're using commenting
/supplementing
)
Also this behaviour was changed between Mirador 2 and 3 for UX reason
In IIIF terms, the canvas target area selected in the annotation only tell that the annotation concern this area, and not that the annotation should be rendered on this area
--
There is probably others things to take into account, and in particular on the annotation format since there is no official example for an annotation containing an image
the two fixe below had been quickly implemented in the associated git branch
- The team from Tokyo used annotations with images like this one:
{
"id": "https://dzkimgs.l.u-tokyo.ac.jp/videos/iiif_in_japan_2017/canvas/1/annotation/1/1.2",
"type": "Annotation",
"motivation": "supplementing",
"body": {
"id": "https://dzkimgs.l.u-tokyo.ac.jp/videos/iiif_in_japan_2017/add_corp.png",
"type": "Image",
"format": "image/png",
"language": "ja",
"value": "IT企業リストを追記(2020年版)"
},
"target": "https://dzkimgs.l.u-tokyo.ac.jp/videos/iiif_in_japan_2017/canvas/1#xywh=750,10,550,350&t=155,210"
}
That is not compliant to the W3C Web Annotation data model which don't accept a text value on an Image body, but wants multiples body for this case, like this :
{
"id": "https://dzkimgs.l.u-tokyo.ac.jp/videos/iiif_in_japan_2017/canvas/1/annotation/1/1.2",
"type": "Annotation",
"motivation": "supplementing",
"body": [
{
"id": "https://dzkimgs.l.u-tokyo.ac.jp/videos/iiif_in_japan_2017/add_corp.png",
"type": "Image",
"format": "image/png",
},
{
"id": "https://dzkimgs.l.u-tokyo.ac.jp/videos/iiif_in_japan_2017/text_comment",
"type": "TextualBody",
"language": "ja",
"value": "IT企業リストを追記(2020年版)"
},
],
"target": "https://dzkimgs.l.u-tokyo.ac.jp/videos/iiif_in_japan_2017/canvas/1#xywh=750,10,550,350&t=155,210"
}
They modified Mirador to take images into account, but we need to make Mirador aware of multiples bodies.
- They used only MediaFragments selectors (
#xywh=750,10,550,350&t=155,210
), where the annotation plugin also use SVG selector. Currently, for printing annotation on the screen, Mirador search at first for the svg selector, and if it is not found, it search for the MediaFragment.
For an unknown reason, images are only drawn on the canvas if they are associated with a media fragment selector, so the patch is to draw both SVG selector and MediaFragment (but it breaks a test)