diff --git a/src/AnnotationCreation.js b/src/AnnotationCreation.js index 2758ace742e5b6e71024c9b9a96ff436d856984b..0b97a01c781123c7bd8fa604ad516bcec7e52059 100644 --- a/src/AnnotationCreation.js +++ b/src/AnnotationCreation.js @@ -16,7 +16,6 @@ import LocalOfferIcon from '@mui/icons-material/LocalOffer'; import HubIcon from '@mui/icons-material/Hub'; import { TabContext, TabList, TabPanel } from '@mui/lab'; import AnnotationDrawing from './annotationForm/AnnotationDrawing'; -import WebAnnotation from './WebAnnotation'; import { secondsToHMS } from './utils'; import AnnotationFormContent from './annotationForm/AnnotationFormContent'; import AnnotationFormTime from './annotationForm/AnnotationFormTime'; @@ -327,11 +326,6 @@ function AnnotationCreation(props) { config, } = props; - // const dumbIimage = { - // id: null, - // svg, - // }; - // state.image = dumbIimage; const drawingStateSerialized = JSON.stringify(drawingState); @@ -349,7 +343,6 @@ function AnnotationCreation(props) { const drawingImageExport = svg; const t = (tstart && tend) ? `${tstart},${tend}` : null; const body = { value: (!textBody.length && t) ? `${secondsToHMS(tstart)} -> ${secondsToHMS(tend)}` : textBody }; - saveAnnotation(canvases, config, receiveAnnotation, annotation, body, t, xywh, image, drawingStateSerialized, drawingImageExport, tags); props.closeCompanionWindow('annotationCreation', { diff --git a/src/AnnotationCreationUtils.js b/src/AnnotationCreationUtils.js index be5aa4cac24f9dcafc00d362f48e91e9832b9024..669cb51c345dfa485765a1c4d986d9aec502aa02 100644 --- a/src/AnnotationCreationUtils.js +++ b/src/AnnotationCreationUtils.js @@ -126,3 +126,22 @@ const sendFile = async (fileContent) => { console.error('Error uploading file:', error); } }; + + +// export function dataURLtoBlob(dataurl) { +// // Split the Data URL to get the metadata and the actual data +// console.log('Data URL:', dataurl); +// var arr = dataurl.split(','), +// mime = arr[0].match(/:(.*?);/)[1], // Extract MIME type +// bstr = atob(arr[1]), // Decode base64 +// n = bstr.length, +// u8arr = new Uint8Array(n); // Create a new ArrayBuffer +// +// // Convert the binary string to an ArrayBuffer +// while(n--){ +// u8arr[n] = bstr.charCodeAt(n); +// } +// +// // Return a Blob object +// return new Blob([u8arr], {type:mime}); +}