Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Mirador annotations
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
IIIF
Mirador
Mirador annotations
Commits
f88a29c5
Commit
f88a29c5
authored
1 year ago
by
Anthony
Browse files
Options
Downloads
Patches
Plain Diff
WIP saving from svg
parent
29851f95
No related branches found
No related tags found
1 merge request
!10
Draft: MigratingAnnotationCreation to MUI5.
Pipeline
#1916
failed
1 year ago
Stage: test
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/AnnotationCreation.js
+0
-7
0 additions, 7 deletions
src/AnnotationCreation.js
src/AnnotationCreationUtils.js
+19
-0
19 additions, 0 deletions
src/AnnotationCreationUtils.js
with
19 additions
and
7 deletions
src/AnnotationCreation.js
+
0
−
7
View file @
f88a29c5
...
@@ -16,7 +16,6 @@ import LocalOfferIcon from '@mui/icons-material/LocalOffer';
...
@@ -16,7 +16,6 @@ import LocalOfferIcon from '@mui/icons-material/LocalOffer';
import
HubIcon
from
'
@mui/icons-material/Hub
'
;
import
HubIcon
from
'
@mui/icons-material/Hub
'
;
import
{
TabContext
,
TabList
,
TabPanel
}
from
'
@mui/lab
'
;
import
{
TabContext
,
TabList
,
TabPanel
}
from
'
@mui/lab
'
;
import
AnnotationDrawing
from
'
./annotationForm/AnnotationDrawing
'
;
import
AnnotationDrawing
from
'
./annotationForm/AnnotationDrawing
'
;
import
WebAnnotation
from
'
./WebAnnotation
'
;
import
{
secondsToHMS
}
from
'
./utils
'
;
import
{
secondsToHMS
}
from
'
./utils
'
;
import
AnnotationFormContent
from
'
./annotationForm/AnnotationFormContent
'
;
import
AnnotationFormContent
from
'
./annotationForm/AnnotationFormContent
'
;
import
AnnotationFormTime
from
'
./annotationForm/AnnotationFormTime
'
;
import
AnnotationFormTime
from
'
./annotationForm/AnnotationFormTime
'
;
...
@@ -327,11 +326,6 @@ function AnnotationCreation(props) {
...
@@ -327,11 +326,6 @@ function AnnotationCreation(props) {
config
,
config
,
}
=
props
;
}
=
props
;
// const dumbIimage = {
// id: null,
// svg,
// };
// state.image = dumbIimage;
const
drawingStateSerialized
=
JSON
.
stringify
(
drawingState
);
const
drawingStateSerialized
=
JSON
.
stringify
(
drawingState
);
...
@@ -349,7 +343,6 @@ function AnnotationCreation(props) {
...
@@ -349,7 +343,6 @@ function AnnotationCreation(props) {
const
drawingImageExport
=
svg
;
const
drawingImageExport
=
svg
;
const
t
=
(
tstart
&&
tend
)
?
`
${
tstart
}
,
${
tend
}
`
:
null
;
const
t
=
(
tstart
&&
tend
)
?
`
${
tstart
}
,
${
tend
}
`
:
null
;
const
body
=
{
value
:
(
!
textBody
.
length
&&
t
)
?
`
${
secondsToHMS
(
tstart
)}
->
${
secondsToHMS
(
tend
)}
`
:
textBody
};
const
body
=
{
value
:
(
!
textBody
.
length
&&
t
)
?
`
${
secondsToHMS
(
tstart
)}
->
${
secondsToHMS
(
tend
)}
`
:
textBody
};
saveAnnotation
(
canvases
,
config
,
receiveAnnotation
,
annotation
,
body
,
t
,
xywh
,
image
,
drawingStateSerialized
,
drawingImageExport
,
tags
);
saveAnnotation
(
canvases
,
config
,
receiveAnnotation
,
annotation
,
body
,
t
,
xywh
,
image
,
drawingStateSerialized
,
drawingImageExport
,
tags
);
props
.
closeCompanionWindow
(
'
annotationCreation
'
,
{
props
.
closeCompanionWindow
(
'
annotationCreation
'
,
{
...
...
This diff is collapsed.
Click to expand it.
src/AnnotationCreationUtils.js
+
19
−
0
View file @
f88a29c5
...
@@ -126,3 +126,22 @@ const sendFile = async (fileContent) => {
...
@@ -126,3 +126,22 @@ const sendFile = async (fileContent) => {
console
.
error
(
'
Error uploading file:
'
,
error
);
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});
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment