KamoCRM

Convert iPhone HEIC photos to PDF, and turn phone photos upright

FixConversionService
Shipped
November 7, 2026 at 10:48 PM UTC
Author
Kamo
Commit
125ab4b

Every HEIC a member uploaded failed: convert-to-pdf only treated png/jpg/tiff/bmp/gif as images, so a .heic fell through to Docs, which cannot open HEIF and answered 500 — the member was told to upload a JPG, PNG or PDF for a photo straight off their phone. - HeifDecoder runs libheif's heif-dec (Alpine libheif-tools, added to the image) as a subprocess to decode the primary image to an upright JPEG (irot/imir applied, EXIF orientation reset); bounded by a pixel cap, a timeout and two concurrent slots. AVIF rides the same path. - WebP is decoded by ffmpeg (demuxer pinned) instead of failing in Docs. - Formats are sniffed by content too, so a HEIC named image.jpg still converts. - A JPEG whose EXIF orientation says it lies on its side (every portrait phone photo) is turned upright before embedding; untagged JPEGs are still embedded byte-for-byte. Verified with a real 3992x2992 tiled camera HEIC and an iPhone-style irot HEIC through ImageToPdfService inside the service's own Alpine image with libheif-tools installed.

All changes

Like what you see shipping?

All of it arrives in your workspace on its own. Start on the free plan and read this page again in a month.

Start Free ForeverView Pricing