Skip to content

dietpi-software: Immich: add support for HEIF/HEIC images #8211

Description

@MichaIng

Immich uses https://github.com/lovell/sharp for image processing, which by default ships with an own statically linked build of libvips https://github.com/lovell/sharp-libvips.

It however is built without HEIC support, since the project owner fears patent infringement: lovell/sharp-libvips#336

Hence, HEIF is only supported with AV1 codec as AVIF. Forcing sharp to be built against Debian's libvips > libheif does not work, since it somehow fails to recognize the libheif H.265 plugins, and the version is too old on stable Debian.

Hence, the only solution I see, which matches what Immich does for their containers, is to compile libheif from source with H.265 codecs (libde265 and libx265) builtin (instead of as plugins), then compiling libvips against that from source, then forcing sharp to be compiled from source linked against the system libvips dynamically, rather than using sharp-libvips. Doing all this in Immich install however is a very heavy and lengthy process with tons of dependencies.

Hence, I'd currently accept this path only if we distributed own pre-compiled (statically linked) sharp-libvips, or a full Immich package with fully pre-compiled Node environment.


And as a general statement here: That H.265/HEVC like H.264/AVC has such a complex patent situation, slowing down or preventing use in FLOSS projects, whether fear is founded in individual case or not, is a strong argument to just not use it where possible. There is the royalty-free and widely supported alternative AVIF (AV1 codec), for the HEIF container format, with equal compression/quality features. If your devices/software allow it, switch to that one, or webp. You'll be a lot more flexible viewing and processing those images.

HEIC is a dead end, as all major players switched to AVIF. Just a little proof in browser support:

Apple is only early adopter and driver, obviously paying the patent fees, while everyone else will never support it.

With some luck, AV1 will replace HEVC similarly in popularity for videos.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions