From e2ba8d493f4c4bcc0907d584cf1006c5b3a84758 Mon Sep 17 00:00:00 2001 From: "user@node5.net" Date: Mon, 11 Aug 2025 20:29:47 +0200 Subject: Mitigate enroll script image load error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- enroll.py | 3 +-- 1 file changed, 1 insertion(+), 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 -- cgit v1.3.1