From 9cb875ca79c678b596ba8410de4afb711002b24c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Padez?= Date: Sat, 29 Aug 2026 07:41:17 +0100 Subject: [PATCH] core stops claiming HEIC it cannot decode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit the revert above took the ImageMagick path back out of core, where it should never have gone: decoding HEIC needs ImageMagick and libheif-plugin-libde265, and the core has no business acquiring a system dependency for one format. that is a plugin's job. this removes the other half of the same mistake. `heic` and `heif` were in core's extension list from the day the thumbnailer was written, which made `ls` promise a thumbnail sharp cannot produce — so every HEIC in a folder cost a request that 422'd before falling back to the icon, and the promise was the only reason the request happened. so without a plugin the file browser is now what it was: a file icon for a HEIC, and no wasted round trip earning it. Co-Authored-By: Claude Opus 5 Officer-Session: 656f5c85-e49a-4f1f-b9f3-042a04b4d043 --- src/servers/api/file-browser/thumbnails.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/servers/api/file-browser/thumbnails.ts b/src/servers/api/file-browser/thumbnails.ts index 82de48be..e4b8c75d 100644 --- a/src/servers/api/file-browser/thumbnails.ts +++ b/src/servers/api/file-browser/thumbnails.ts @@ -43,7 +43,18 @@ import sharp from 'sharp'; * two are not exotic — HEIC is what every recent iPhone writes, and a folder of them showing generic * file icons was the most visible gap this had. */ -const IMAGE_EXT = new Set(['jpg', 'jpeg', 'png', 'gif', 'webp', 'bmp', 'avif', 'tif', 'tiff', 'svg', 'heic', 'heif']); +/* + No `heic` or `heif`, and that is not an oversight. + + sharp's bundled libheif is built without the HEVC decoder, so it parses a HEIC's header and then + fails on the pixels. Listing them here made `ls` promise a thumbnail core cannot produce: every HEIC + cost a request that 422'd before falling back to the icon, and the promise was the only reason the + request happened at all. + + Decoding them needs ImageMagick and `libheif-plugin-libde265` — a system dependency the core has no + business acquiring for one format. That belongs to a plugin, and av-club already does it. +*/ +const IMAGE_EXT = new Set(['jpg', 'jpeg', 'png', 'gif', 'webp', 'bmp', 'avif', 'tif', 'tiff', 'svg']); /* `ts` is NOT here, and that is the one entry worth explaining.