metadata: add a UUID to extracted metadata
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
c1eda1ef3d
commit
6f2ce72b4c
|
@ -16,6 +16,7 @@ import traceback
|
||||||
import tempfile
|
import tempfile
|
||||||
import zipfile
|
import zipfile
|
||||||
import shutil
|
import shutil
|
||||||
|
import uuid
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
|
|
||||||
# Annotation imports
|
# Annotation imports
|
||||||
|
@ -824,6 +825,7 @@ def extract_metadata(file_path: str,
|
||||||
size = os.path.getsize(file_path)
|
size = os.path.getsize(file_path)
|
||||||
metadata['size'] = size
|
metadata['size'] = size
|
||||||
metadata['modified'] = os.path.getmtime(file_path)
|
metadata['modified'] = os.path.getmtime(file_path)
|
||||||
|
metadata['uuid'] = str(uuid.uuid4())
|
||||||
with open(file_path, 'r') as f:
|
with open(file_path, 'r') as f:
|
||||||
# read the default size, which should be enough to
|
# read the default size, which should be enough to
|
||||||
# identify the slicer
|
# identify the slicer
|
||||||
|
|
Loading…
Reference in New Issue