Surfaced by the adversarial review of #355, deliberately deferred so that PR could stay a strict no-behavior-change refactor.
IMAGE_EXTENSIONS (photomap/backend/media_types.py) contains .tiff but not .tif, and omits .avif and .jfif. The installed Pillow opens all three — verified: Pillow 12.2.0 with features.check('avif') → True.
Impact
.tif is the dominant spelling from scanners, Photoshop and Windows tooling, and docs/user-guide/basic-usage.md:15 and docs/user-guide/albums.md:32 both promise TIFF support.
- Point an album at 800
scan001.tif files and the walk skips every one before the dimension gate or the reject cache. Indexing reports zero images and the album is silently empty — no error, no warning, nothing in the log.
- The same suffixes are also 403'd by the serving guard (
routers/search.py:323 and :445), since SUPPORTED_EXTENSIONS is that same set.
Why it wasn't fixed in #355
Adding them widens the /images/ and /image_by_name/ allowlist, which is a genuine behavior change — and the whole point of #355 was that it changed nothing, so the diff could be reviewed as a pure rename. It also deserves its own tests rather than riding along with the video work.
Suggested fix
Worth checking .heif/.heic at the same time: they are in the set, but PIL can only open them because register_heif_opener() runs as an import-time side effect in embeddings.py:176. Any future caller importing media_types on its own — which is the entire point of that module being a leaf — gets is_image('x.heic') == True and then UnidentifiedImageError.
Surfaced by the adversarial review of #355, deliberately deferred so that PR could stay a strict no-behavior-change refactor.
IMAGE_EXTENSIONS(photomap/backend/media_types.py) contains.tiffbut not.tif, and omits.avifand.jfif. The installed Pillow opens all three — verified: Pillow 12.2.0 withfeatures.check('avif')→True.Impact
.tifis the dominant spelling from scanners, Photoshop and Windows tooling, anddocs/user-guide/basic-usage.md:15anddocs/user-guide/albums.md:32both promise TIFF support.scan001.tiffiles and the walk skips every one before the dimension gate or the reject cache. Indexing reports zero images and the album is silently empty — no error, no warning, nothing in the log.routers/search.py:323and:445), sinceSUPPORTED_EXTENSIONSis that same set.Why it wasn't fixed in #355
Adding them widens the
/images/and/image_by_name/allowlist, which is a genuine behavior change — and the whole point of #355 was that it changed nothing, so the diff could be reviewed as a pure rename. It also deserves its own tests rather than riding along with the video work.Suggested fix
.tif,.avif,.jfiftoIMAGE_EXTENSIONSEXPECTED_IMAGE_EXTENSIONSintests/backend/test_media_types.py(deliberately pinned to a literal so this cannot change silently).avifsupport is present in the Pillow floor the project actually resolves, not just the locked one — it is conditional on the buildWorth checking
.heif/.heicat the same time: they are in the set, but PIL can only open them becauseregister_heif_opener()runs as an import-time side effect inembeddings.py:176. Any future caller importingmedia_typeson its own — which is the entire point of that module being a leaf — getsis_image('x.heic') == Trueand thenUnidentifiedImageError.