summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruser@node5.net <user@node5.net>2025-08-11 20:29:47 +0200
committeruser@node5.net <user@node5.net>2025-08-11 20:29:47 +0200
commite2ba8d493f4c4bcc0907d584cf1006c5b3a84758 (patch)
tree9f60d31fe47c5e9a36cfda44cc0f8425ec5b8234
parent900b3ec36e9fd1baf37c2bb42814c6f2f073ff5c (diff)
Mitigate enroll script image load errorfix-enroll
My image had different exif data, which threw an exception on load. Fallback to prompting user [nix-shell:~/projects/public/spyoscape]$ python enroll.py static/images/jYSKHELÅRS\ TURiST\ SØGES\ TiL\ BLiD\ OG\ GENSiDiG\ TEAM\ BUiLDiNG.webp Enter the quote: jYSKHELÅRS TURiST SØGES TiL BLiD OG GENSiDiG TEAM BUiLDiNG Enter comma-separated author names (default: SPYO): File "/nix/store/...-python3.13-plum-py-0.8.6/lib/python3.13/site-packages/plum/buffer.py", line 53, in unpack_and_dump raise UnpackError(dump, exc) from exc plum.exceptions.UnpackError: +--------+------------+-------+-------+------------------------+ | Offset | Access | Value | Bytes | Format | +--------+------------+-------+-------+------------------------+ | | | | | TiffHeader (Structure) | | 0 | byte_order | 14422 | 38 56 | tiff_byte_order | +--------+------------+-------+-------+------------------------+ ValueError occurred during unpack operation: 14422 is not a valid TiffByteOrder
-rw-r--r--enroll.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/enroll.py b/enroll.py
index 29f1ab6..2f88b55 100644
--- a/enroll.py
+++ b/enroll.py
@@ -57,9 +57,8 @@ def main():
authors = [author.strip() for author in authors_input.split(",") if author.strip()] if authors_input else ["SPYO"]
with open(filename, 'rb') as image_file:
- image = ExifImage(image_file)
-
try:
+ image = ExifImage(image_file)
lat_deg, lat_sec, lat_min = image.gps_latitude
lat_ref = image.gps_latitude_ref