metadata: add a UUID to extracted metadata

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2022-04-21 06:47:31 -04:00
parent c1eda1ef3d
commit 6f2ce72b4c
No known key found for this signature in database
GPG Key ID: 7027245FBBDDF59A
1 changed files with 2 additions and 0 deletions

View File

@ -16,6 +16,7 @@ import traceback
import tempfile
import zipfile
import shutil
import uuid
from PIL import Image
# Annotation imports
@ -824,6 +825,7 @@ def extract_metadata(file_path: str,
size = os.path.getsize(file_path)
metadata['size'] = size
metadata['modified'] = os.path.getmtime(file_path)
metadata['uuid'] = str(uuid.uuid4())
with open(file_path, 'r') as f:
# read the default size, which should be enough to
# identify the slicer