Skip to content
Snippets Groups Projects
Commit efc3825c authored by Anthony's avatar Anthony
Browse files

Add demo assets

parent 7bfadd24
No related branches found
No related tags found
1 merge request!10Draft: MigratingAnnotationCreation to MUI5.
Pipeline #1910 failed
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1215"
height="684">
<defs/>
<g>
<g>
<path fill="rgb(255,0,0)" stroke="rgb(255,0,0)" paint-order="fill stroke markers"
d=" M 188 197.66666412353516 L 477 197.66666412353516 L 477 524.6666641235352 L 188 524.6666641235352 L 188 197.66666412353516 Z Z"
fill-opacity="0.5" stroke-opacity="0.5" stroke-miterlimit="10" stroke-width="12.65625"
stroke-dasharray=""/>
</g>
<g>
<path fill="rgb(255,0,0)" stroke="rgb(255,0,0)" paint-order="fill stroke markers"
d=" M 625 194.66666412353513 L 916 194.66666412353513 L 916 577.6666641235352 L 625 577.6666641235352 L 625 194.66666412353513 Z Z"
fill-opacity="0.5" stroke-opacity="0.5" stroke-miterlimit="10" stroke-width="12.65625"
stroke-dasharray=""/>
</g>
</g>
</svg>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1215" height="684">
<defs/>
<g>
<g>
<path fill="rgb(255,0,0)" stroke="rgb(255,0,0)" d=" M 143 124.66666412353516 L 392 124.66666412353516 L 392 354.66666412353516 L 143 354.66666412353516 L 143 124.66666412353516 Z Z" fill-opacity="0.5" stroke-opacity="0.5" stroke-miterlimit="10" stroke-width="12.65625" stroke-dasharray=""/>
</g>
<g>
<image width="1800" height="963" preserveAspectRatio="none" transform="matrix(0.3266922638266449 0 0 0.3266922638266448 478.0164251120414 122.79378743494328)" xlink:href="https://presskit.porsche.de/models/assets/images/e/P17_0701_a5_rgb-c04a4c6e.jpg"/>
</g>
<g>
<g>
<text fill="red" stroke="none" font-family="Arial" font-size="40px" font-style="normal" font-weight="normal" text-decoration="undefined" x="0" y="20" text-anchor="start" dominant-baseline="central" transform="matrix(0.6328125 0 0 0.6328125 332.99999999999994 538.6666641235352)">Mon gros Cayenne</text>
</g>
</g>
</g>
</svg>
......@@ -11,7 +11,7 @@ const config = {
exportLocalStorageAnnotations: false, // display annotation JSON export button
},
catalog: [
{ manifestIf: 'https://files.tetras-libre.fr/dev/Clock/manifest.json'},
{ manifestId: 'https://files.tetras-libre.fr/dev/Clock/manifest.json' },
{ manifestId: 'https://files.tetras-libre.fr/dev/Hakanai/manifest/manifest.json' },
{ manifestId: 'https://dzkimgs.l.u-tokyo.ac.jp/videos/iiif_in_japan_2017/manifest.json' },
{ manifestId: 'https://iiif.io/api/cookbook/recipe/0219-using-caption-file/manifest.json' },
......
import {exportStageSVG} from "react-konva-to-svg";
import WebAnnotation from "./WebAnnotation";
import {v4 as uuid} from "uuid";
import axios from 'axios';
/** Extract time information from annotation target */
export function timeFromAnnoTarget(annotarget) {
......@@ -74,6 +75,8 @@ const dumbAnnotation = {
export function saveAnnotation(canvases, config, receiveAnnotation, annotation, body, t, xywh, image, drawingStateSerialized, svg, tags){
// TODO promises not handled. Use promiseAll ?
canvases.forEach(async (canvas) => {
const storageAdapter = config.annotation.adapter(canvas.id);
// const anno = new WebAnnotation({
......@@ -107,3 +110,22 @@ export function saveAnnotation(canvases, config, receiveAnnotation, annotation,
}
});
}
const sendFile = async () => {
const fileContent = 'Hello, this is a test file';
const blob = new Blob([fileContent], { type: 'text/plain' });
const formData = new FormData();
formData.append('file', blob);
try {
const response = await axios.post('http://localhost:3001/upload', formData, {
headers: {
'Content-Type': 'multipart/form-data',
},
});
console.log('File Uploaded', response.data);
} catch (error) {
console.error('Error uploading file:', error);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment