Skip to content
Snippets Groups Projects
Verified Commit 5f15bf9c authored by Loïs Poujade's avatar Loïs Poujade
Browse files

Minimal adaptation for images in annotations

- read all body to find images
- show both FragmentSelector and SVG Selector
parent e366a537
No related branches found
No related tags found
1 merge request!10Minimal adaptation for images in annotations
Pipeline #1267 failed
......@@ -417,13 +417,14 @@ export class AnnotationsOverlayVideo extends Component {
return { height: 0, width: 0 };
}
/** @private */
/** @private - Returns the first Image body */
getResourceImage(resource) {
let imageSource;
if (resource.body && resource.body.length > 0 && resource.body[0].type === 'Image') {
const src = resource.body[0].id;
const imageSource = [];
for (const body of resource.body.filter(b => b.type === 'Image')) {
const src = body.id;
if (this.imagesReady[src]) {
imageSource = this.imagesReady[src];
imageSource.push(this.imagesReady[src]);
} else if (!this.imagesLoading.includes(src)) {
this.imagesLoading.push(src);
const img = new Image();
......@@ -433,7 +434,8 @@ export class AnnotationsOverlayVideo extends Component {
img.src = src;
}
}
return imageSource;
return imageSource[0];
}
/** @private */
......
......@@ -22,7 +22,8 @@ export default class CanvasAnnotationDisplay {
this.context = context;
if (this.resource.svgSelector) {
this.svgContext();
} else if (this.resource.fragmentSelector) {
}
if (this.resource.fragmentSelector) {
this.fragmentContext();
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment