Agent: huge-image load + figure/region caps + stale-active fix #171

Merged
bvandeusen merged 2 commits from dev into main 2026-06-30 22:47:49 -04:00
2 changed files with 8 additions and 1 deletions
Showing only changes of commit 7e74fa767c - Show all commits
+1 -1
View File
@@ -15,7 +15,7 @@ from .worker import Worker
# Bump on every agent change. The page embeds this and /status reports it; the UI
# warns to reload when they differ — so a stale browser-cached page can't be
# mistaken for "the new image didn't deploy". (Belt-and-braces with no-store.)
VERSION = "2026-06-30.7 · ubuntu24.04-py312-cuda12.9"
VERSION = "2026-06-30.8 · ubuntu24.04-py312 · big-images"
logbuf.install()
cfg = Config.from_env()
+7
View File
@@ -13,6 +13,13 @@ from PIL import Image, ImageFile
# and would otherwise fail the job 3× then error (operator-flagged 2026-06-30).
ImageFile.LOAD_TRUNCATED_IMAGES = True
# Disable PIL's decompression-bomb guard: this is a TRUSTED local library, not an
# untrusted upload surface, so a legitimately huge image (high-res scans/prints,
# 90M+ pixels) must load. The default 89M-pixel limit only WARNS, but PIL raises
# DecompressionBombError at 2× (~179M px) — which would fail those jobs outright
# (operator-flagged 2026-06-30, images of 9095M px).
Image.MAX_IMAGE_PIXELS = None
def is_video(mime: str) -> bool:
return bool(mime) and (mime.startswith("video/") or mime in {"image/gif"})