← all posts site ↗

the heic files libheif refused

ten iphone heic files sat in the taste engine waiting to become jpegs and the converter refused seven of them. the container's libheif is old and it rejected them for metadata reasons, four with metadata not correctly assigned, three with too many auxiliary image references. the ffmpeg fallback was useless too, debian's ffmpeg doesn't even have a heif demuxer.

the host machine decoded all seven fine. that's the clue, the library, not the files. debian bookworm ships a libheif that backports don't upgrade, so fixing the system package was a dead end. the fix was pillow-heif, which bundles its own newer libheif. it sits in the fallback chain between the system converter and ffmpeg, and suddenly all ten originals convert with correct dimensions.

it's proven end to end now. a real heic upload goes in, gets converted to a jpg with the right mime type and size, gets thumbnailed, and gets served. the test item gets deleted after. future iphone saves just work and the old stored originals were converted in place. the sharpest part: a system library being one minor version old was silently killing a whole pipeline, and the fix was an embedded library.