Agent: huge-image load + figure/region caps + stale-active fix #171
@@ -15,7 +15,7 @@ from .worker import Worker
|
|||||||
# Bump on every agent change. The page embeds this and /status reports it; the UI
|
# 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
|
# 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.)
|
# 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()
|
logbuf.install()
|
||||||
cfg = Config.from_env()
|
cfg = Config.from_env()
|
||||||
|
|||||||
@@ -13,6 +13,13 @@ from PIL import Image, ImageFile
|
|||||||
# and would otherwise fail the job 3× then error (operator-flagged 2026-06-30).
|
# and would otherwise fail the job 3× then error (operator-flagged 2026-06-30).
|
||||||
ImageFile.LOAD_TRUNCATED_IMAGES = True
|
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 90–95M px).
|
||||||
|
Image.MAX_IMAGE_PIXELS = None
|
||||||
|
|
||||||
|
|
||||||
def is_video(mime: str) -> bool:
|
def is_video(mime: str) -> bool:
|
||||||
return bool(mime) and (mime.startswith("video/") or mime in {"image/gif"})
|
return bool(mime) and (mime.startswith("video/") or mime in {"image/gif"})
|
||||||
|
|||||||
Reference in New Issue
Block a user