From 30b1a7f62473f0c745d936d3ebedcde174636bb4 Mon Sep 17 00:00:00 2001 From: "anthropic-code-agent[bot]" <242468646+Claude@users.noreply.github.com> Date: Thu, 19 Mar 2026 19:44:54 +0000 Subject: [PATCH 1/9] Initial plan From 17c88dbeb0cca98cb205a0c16dc0f377e8cac316 Mon Sep 17 00:00:00 2001 From: "anthropic-code-agent[bot]" <242468646+Claude@users.noreply.github.com> Date: Thu, 19 Mar 2026 19:47:49 +0000 Subject: [PATCH 2/9] Add libheif dependencies for HEIC image support in Immich Co-authored-by: Joulinar <47155374+Joulinar@users.noreply.github.com> --- dietpi/dietpi-software | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 6d785cf571..4d2525e5a3 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -11972,7 +11972,8 @@ _EOF_ then # Install pgvector and VectorChord extensions: https://immich.app/docs/administration/postgres-standalone local pg_version=$(find /etc/postgresql -mindepth 1 -maxdepth 1 -type d -name '[1-9][0-9]' -printf '%f\n' | sort -Vr | head -1) - aDEPS=("postgresql-$pg_version-pgvector") + # Install libheif for HEIC image format support in Sharp module + aDEPS=("postgresql-$pg_version-pgvector" 'libheif1' 'libheif-plugin-libde265') local arch='amd64' (( $G_HW_ARCH == 3 )) && local arch='arm64' local fallback_url="https://github.com/tensorchord/VectorChord/releases/download/1.1.0/postgresql-$pg_version-vchord_1.1.0-1_$arch.deb" From c5a42f567505acbb92975a97059223fb92490cec Mon Sep 17 00:00:00 2001 From: "anthropic-code-agent[bot]" <242468646+Claude@users.noreply.github.com> Date: Thu, 19 Mar 2026 20:02:30 +0000 Subject: [PATCH 3/9] Fix HEIC support by forcing Sharp to use system libvips The previous fix (installing libheif1 and libheif-plugin-libde265) didn't work because Sharp uses prebuilt binaries by default, which don't utilize system libraries. Sharp's prebuilt binaries explicitly disable libde265 HEVC decoder, making them unable to process standard Apple HEIC files. Solution: - Install libvips-dev and libheif-dev (build dependencies) - Set SHARP_FORCE_GLOBAL_LIBVIPS=true to force Sharp to compile against system libvips - Remove dev packages after build - Runtime automatically uses libvips42t64 (includes libheif1 and libde265-0) This matches how Immich's official Docker images handle HEIC support. Co-authored-by: Joulinar <47155374+Joulinar@users.noreply.github.com> --- dietpi/dietpi-software | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 4d2525e5a3..d6d2f92e10 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -11972,8 +11972,10 @@ _EOF_ then # Install pgvector and VectorChord extensions: https://immich.app/docs/administration/postgres-standalone local pg_version=$(find /etc/postgresql -mindepth 1 -maxdepth 1 -type d -name '[1-9][0-9]' -printf '%f\n' | sort -Vr | head -1) - # Install libheif for HEIC image format support in Sharp module - aDEPS=("postgresql-$pg_version-pgvector" 'libheif1' 'libheif-plugin-libde265') + # Install build dependencies for Sharp with HEIC support via system libvips + # libvips-dev and libheif-dev are needed to compile Sharp against system libvips + # Runtime: libvips42t64 (includes libheif1 dependency) provides HEIC support + aDEPS=("postgresql-$pg_version-pgvector" 'libvips-dev' 'libheif-dev') local arch='amd64' (( $G_HW_ARCH == 3 )) && local arch='arm64' local fallback_url="https://github.com/tensorchord/VectorChord/releases/download/1.1.0/postgresql-$pg_version-vchord_1.1.0-1_$arch.deb" @@ -12016,6 +12018,10 @@ _EOF_ # Prevent JavaScript OOM during build export NODE_OPTIONS='--max-old-space-size=4096' + # Force Sharp to use system libvips for HEIC support + # This ensures Sharp uses the system's libvips (with HEIC/libde265 support) instead of prebuilt binaries + export SHARP_FORCE_GLOBAL_LIBVIPS=true + # Install Node dependencies G_EXEC_OUTPUT=1 G_EXEC pnpm --filter immich --filter @immich/sdk --filter immich-web --filter plugins i @@ -12028,7 +12034,10 @@ _EOF_ # Deploy server [[ -d '/opt/immich' ]] && G_EXEC rm -R /opt/immich G_EXEC_OUTPUT=1 G_EXEC pnpm --filter immich -P deploy /opt/immich - unset -v NODE_OPTIONS + unset -v NODE_OPTIONS SHARP_FORCE_GLOBAL_LIBVIPS + + # Remove development packages, keep runtime libraries (libvips42t64, libheif1, libde265-0) + G_AGP libvips-dev libheif-dev # Install web frontend and WebAssembly workflow plugin G_EXEC mv web/build /opt/immich/www From b95b99e70135d7cd9ec04441dc4717caff214206 Mon Sep 17 00:00:00 2001 From: "anthropic-code-agent[bot]" <242468646+Claude@users.noreply.github.com> Date: Thu, 19 Mar 2026 21:00:59 +0000 Subject: [PATCH 4/9] Build libvips 8.17.3 from source for full HEIC support in Immich Co-authored-by: Joulinar <47155374+Joulinar@users.noreply.github.com> --- dietpi/dietpi-software | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index d6d2f92e10..eb31772d36 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -11972,10 +11972,8 @@ _EOF_ then # Install pgvector and VectorChord extensions: https://immich.app/docs/administration/postgres-standalone local pg_version=$(find /etc/postgresql -mindepth 1 -maxdepth 1 -type d -name '[1-9][0-9]' -printf '%f\n' | sort -Vr | head -1) - # Install build dependencies for Sharp with HEIC support via system libvips - # libvips-dev and libheif-dev are needed to compile Sharp against system libvips - # Runtime: libvips42t64 (includes libheif1 dependency) provides HEIC support - aDEPS=("postgresql-$pg_version-pgvector" 'libvips-dev' 'libheif-dev') + # Build dependencies for libvips with HEIC support + aDEPS=("postgresql-$pg_version-pgvector" 'git' 'meson' 'ninja-build' 'pkg-config' 'libglib2.0-dev' 'libexpat1-dev' 'libexif-dev' 'libjpeg-dev' 'libpng-dev' 'libwebp-dev' 'libheif-dev' 'libde265-dev') local arch='amd64' (( $G_HW_ARCH == 3 )) && local arch='arm64' local fallback_url="https://github.com/tensorchord/VectorChord/releases/download/1.1.0/postgresql-$pg_version-vchord_1.1.0-1_$arch.deb" @@ -12018,8 +12016,20 @@ _EOF_ # Prevent JavaScript OOM during build export NODE_OPTIONS='--max-old-space-size=4096' - # Force Sharp to use system libvips for HEIC support - # This ensures Sharp uses the system's libvips (with HEIC/libde265 support) instead of prebuilt binaries + # Build libvips 8.17.3 from source for full HEIC support + # Sharp 0.34.5+ requires libvips 8.17.3+, but system packages only provide 8.15.1 + G_DIETPI-NOTIFY 2 'Building libvips 8.17.3 from source for HEIC support...' + G_EXEC cd /tmp + G_EXEC git clone https://github.com/libvips/libvips.git + G_EXEC cd libvips + G_EXEC git reset --hard 0c9151a4f416d2f8ae20a755db218f6637050eec # v8.17.3 + G_EXEC meson setup build --buildtype=release --libdir=lib -Dintrospection=disabled + G_EXEC ninja -C build install + G_EXEC cd /tmp + G_EXEC rm -rf libvips + G_EXEC ldconfig /usr/local/lib + + # Force Sharp to use system libvips with HEIC support export SHARP_FORCE_GLOBAL_LIBVIPS=true # Install Node dependencies @@ -12028,17 +12038,15 @@ _EOF_ # Build Immich server, web UI (requires Immich SDK), and WebAssembly workflow plugin G_EXEC_OUTPUT=1 G_EXEC pnpm --filter immich --filter @immich/sdk --filter immich-web --filter plugins build - # Remove build-time tools + # Remove build-time tools and dependencies G_EXEC rm /usr/local/bin/extism-js /usr/local/bin/wasm-merge /usr/local/bin/wasm-opt + G_AGP git meson ninja-build pkg-config libglib2.0-dev libexpat1-dev libexif-dev libjpeg-dev libpng-dev libwebp-dev libheif-dev libde265-dev # Deploy server [[ -d '/opt/immich' ]] && G_EXEC rm -R /opt/immich G_EXEC_OUTPUT=1 G_EXEC pnpm --filter immich -P deploy /opt/immich unset -v NODE_OPTIONS SHARP_FORCE_GLOBAL_LIBVIPS - # Remove development packages, keep runtime libraries (libvips42t64, libheif1, libde265-0) - G_AGP libvips-dev libheif-dev - # Install web frontend and WebAssembly workflow plugin G_EXEC mv web/build /opt/immich/www G_EXEC mkdir /opt/immich/corePlugin From 1d9c0c3e41ef83037f62adc265168da5a3f430f3 Mon Sep 17 00:00:00 2001 From: "anthropic-code-agent[bot]" <242468646+Claude@users.noreply.github.com> Date: Thu, 19 Mar 2026 21:29:01 +0000 Subject: [PATCH 5/9] Keep libvips build within immich_src instead of /tmp Co-authored-by: Joulinar <47155374+Joulinar@users.noreply.github.com> --- dietpi/dietpi-software | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index eb31772d36..7cada17d23 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -12019,13 +12019,12 @@ _EOF_ # Build libvips 8.17.3 from source for full HEIC support # Sharp 0.34.5+ requires libvips 8.17.3+, but system packages only provide 8.15.1 G_DIETPI-NOTIFY 2 'Building libvips 8.17.3 from source for HEIC support...' - G_EXEC cd /tmp G_EXEC git clone https://github.com/libvips/libvips.git G_EXEC cd libvips G_EXEC git reset --hard 0c9151a4f416d2f8ae20a755db218f6637050eec # v8.17.3 G_EXEC meson setup build --buildtype=release --libdir=lib -Dintrospection=disabled G_EXEC ninja -C build install - G_EXEC cd /tmp + G_EXEC cd "$immich_src" G_EXEC rm -rf libvips G_EXEC ldconfig /usr/local/lib From 2a2f1a3e91371451355d6ab0200a2c63edddc214 Mon Sep 17 00:00:00 2001 From: "anthropic-code-agent[bot]" <242468646+Claude@users.noreply.github.com> Date: Thu, 19 Mar 2026 21:46:15 +0000 Subject: [PATCH 6/9] Add make dependency and use latest libvips version Co-authored-by: Joulinar <47155374+Joulinar@users.noreply.github.com> --- dietpi/dietpi-software | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 7cada17d23..5271455850 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -11973,7 +11973,7 @@ _EOF_ # Install pgvector and VectorChord extensions: https://immich.app/docs/administration/postgres-standalone local pg_version=$(find /etc/postgresql -mindepth 1 -maxdepth 1 -type d -name '[1-9][0-9]' -printf '%f\n' | sort -Vr | head -1) # Build dependencies for libvips with HEIC support - aDEPS=("postgresql-$pg_version-pgvector" 'git' 'meson' 'ninja-build' 'pkg-config' 'libglib2.0-dev' 'libexpat1-dev' 'libexif-dev' 'libjpeg-dev' 'libpng-dev' 'libwebp-dev' 'libheif-dev' 'libde265-dev') + aDEPS=("postgresql-$pg_version-pgvector" 'git' 'make' 'meson' 'ninja-build' 'pkg-config' 'libglib2.0-dev' 'libexpat1-dev' 'libexif-dev' 'libjpeg-dev' 'libpng-dev' 'libwebp-dev' 'libheif-dev' 'libde265-dev') local arch='amd64' (( $G_HW_ARCH == 3 )) && local arch='arm64' local fallback_url="https://github.com/tensorchord/VectorChord/releases/download/1.1.0/postgresql-$pg_version-vchord_1.1.0-1_$arch.deb" @@ -12016,12 +12016,11 @@ _EOF_ # Prevent JavaScript OOM during build export NODE_OPTIONS='--max-old-space-size=4096' - # Build libvips 8.17.3 from source for full HEIC support + # Build libvips from source for full HEIC support # Sharp 0.34.5+ requires libvips 8.17.3+, but system packages only provide 8.15.1 - G_DIETPI-NOTIFY 2 'Building libvips 8.17.3 from source for HEIC support...' - G_EXEC git clone https://github.com/libvips/libvips.git + G_DIETPI-NOTIFY 2 'Building latest libvips from source for HEIC support...' + G_EXEC git clone --depth=1 https://github.com/libvips/libvips.git G_EXEC cd libvips - G_EXEC git reset --hard 0c9151a4f416d2f8ae20a755db218f6637050eec # v8.17.3 G_EXEC meson setup build --buildtype=release --libdir=lib -Dintrospection=disabled G_EXEC ninja -C build install G_EXEC cd "$immich_src" @@ -12039,7 +12038,7 @@ _EOF_ # Remove build-time tools and dependencies G_EXEC rm /usr/local/bin/extism-js /usr/local/bin/wasm-merge /usr/local/bin/wasm-opt - G_AGP git meson ninja-build pkg-config libglib2.0-dev libexpat1-dev libexif-dev libjpeg-dev libpng-dev libwebp-dev libheif-dev libde265-dev + G_AGP git make meson ninja-build pkg-config libglib2.0-dev libexpat1-dev libexif-dev libjpeg-dev libpng-dev libwebp-dev libheif-dev libde265-dev # Deploy server [[ -d '/opt/immich' ]] && G_EXEC rm -R /opt/immich From c2e1c6e4bcc5bd6998b6ff90e50c1788db8f2ef6 Mon Sep 17 00:00:00 2001 From: "anthropic-code-agent[bot]" <242468646+Claude@users.noreply.github.com> Date: Thu, 19 Mar 2026 21:53:55 +0000 Subject: [PATCH 7/9] Add libx265-dev for HEIC encoding support in Immich Co-authored-by: Joulinar <47155374+Joulinar@users.noreply.github.com> --- dietpi/dietpi-software | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 5271455850..ebf3cd3a58 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -11973,7 +11973,7 @@ _EOF_ # Install pgvector and VectorChord extensions: https://immich.app/docs/administration/postgres-standalone local pg_version=$(find /etc/postgresql -mindepth 1 -maxdepth 1 -type d -name '[1-9][0-9]' -printf '%f\n' | sort -Vr | head -1) # Build dependencies for libvips with HEIC support - aDEPS=("postgresql-$pg_version-pgvector" 'git' 'make' 'meson' 'ninja-build' 'pkg-config' 'libglib2.0-dev' 'libexpat1-dev' 'libexif-dev' 'libjpeg-dev' 'libpng-dev' 'libwebp-dev' 'libheif-dev' 'libde265-dev') + aDEPS=("postgresql-$pg_version-pgvector" 'git' 'make' 'meson' 'ninja-build' 'pkg-config' 'libglib2.0-dev' 'libexpat1-dev' 'libexif-dev' 'libjpeg-dev' 'libpng-dev' 'libwebp-dev' 'libheif-dev' 'libde265-dev' 'libx265-dev') local arch='amd64' (( $G_HW_ARCH == 3 )) && local arch='arm64' local fallback_url="https://github.com/tensorchord/VectorChord/releases/download/1.1.0/postgresql-$pg_version-vchord_1.1.0-1_$arch.deb" @@ -12038,7 +12038,7 @@ _EOF_ # Remove build-time tools and dependencies G_EXEC rm /usr/local/bin/extism-js /usr/local/bin/wasm-merge /usr/local/bin/wasm-opt - G_AGP git make meson ninja-build pkg-config libglib2.0-dev libexpat1-dev libexif-dev libjpeg-dev libpng-dev libwebp-dev libheif-dev libde265-dev + G_AGP git make meson ninja-build pkg-config libglib2.0-dev libexpat1-dev libexif-dev libjpeg-dev libpng-dev libwebp-dev libheif-dev libde265-dev libx265-dev # Deploy server [[ -d '/opt/immich' ]] && G_EXEC rm -R /opt/immich From a33a6cb904127fd13dfb4d46816f6be4c4823a76 Mon Sep 17 00:00:00 2001 From: "anthropic-code-agent[bot]" <242468646+Claude@users.noreply.github.com> Date: Thu, 19 Mar 2026 22:07:28 +0000 Subject: [PATCH 8/9] Install libheif-plugin-x265 for HEIC encoding runtime support Co-authored-by: Joulinar <47155374+Joulinar@users.noreply.github.com> --- dietpi/dietpi-software | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index ebf3cd3a58..99116bd1b0 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -11979,6 +11979,9 @@ _EOF_ local fallback_url="https://github.com/tensorchord/VectorChord/releases/download/1.1.0/postgresql-$pg_version-vchord_1.1.0-1_$arch.deb" Download_Install "$(curl -sSfL 'https://api.github.com/repos/tensorchord/VectorChord/releases/latest' | grep -Po "\"browser_download_url\": *\"\K[^\"]*-$pg_version-vchord_[^\"\/]*_$arch.deb")" + # Install HEIC encoder plugin for runtime (must remain after build deps are removed) + G_AGI libheif-plugin-x265 + # Download Immich source local version=$(curl -sSfL 'https://api.github.com/repos/immich-app/immich/releases/latest' | grep -Po '"tag_name": *"\K[^"]+') [[ $version ]] || { version='v2.5.6'; G_DIETPI-NOTIFY 1 "Automatic latest ${aSOFTWARE_NAME[$software_id]} version detection failed. Version \"$version\" will be installed as fallback, but a newer version might be available. Please report this at: https://github.com/MichaIng/DietPi/issues"; } From be92e03551e00dc31e022918879d52816b9e8a68 Mon Sep 17 00:00:00 2001 From: "anthropic-code-agent[bot]" <242468646+Claude@users.noreply.github.com> Date: Thu, 19 Mar 2026 23:17:39 +0000 Subject: [PATCH 9/9] Build libheif from source with x265 and de265 encoders enabled Co-authored-by: Joulinar <47155374+Joulinar@users.noreply.github.com> --- dietpi/dietpi-software | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 99116bd1b0..8bd526b022 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -11973,15 +11973,12 @@ _EOF_ # Install pgvector and VectorChord extensions: https://immich.app/docs/administration/postgres-standalone local pg_version=$(find /etc/postgresql -mindepth 1 -maxdepth 1 -type d -name '[1-9][0-9]' -printf '%f\n' | sort -Vr | head -1) # Build dependencies for libvips with HEIC support - aDEPS=("postgresql-$pg_version-pgvector" 'git' 'make' 'meson' 'ninja-build' 'pkg-config' 'libglib2.0-dev' 'libexpat1-dev' 'libexif-dev' 'libjpeg-dev' 'libpng-dev' 'libwebp-dev' 'libheif-dev' 'libde265-dev' 'libx265-dev') + aDEPS=("postgresql-$pg_version-pgvector" 'git' 'make' 'cmake' 'meson' 'ninja-build' 'pkg-config' 'libglib2.0-dev' 'libexpat1-dev' 'libexif-dev' 'libjpeg-dev' 'libpng-dev' 'libwebp-dev' 'libde265-dev' 'libx265-dev' 'libheif-plugin-x265') local arch='amd64' (( $G_HW_ARCH == 3 )) && local arch='arm64' local fallback_url="https://github.com/tensorchord/VectorChord/releases/download/1.1.0/postgresql-$pg_version-vchord_1.1.0-1_$arch.deb" Download_Install "$(curl -sSfL 'https://api.github.com/repos/tensorchord/VectorChord/releases/latest' | grep -Po "\"browser_download_url\": *\"\K[^\"]*-$pg_version-vchord_[^\"\/]*_$arch.deb")" - # Install HEIC encoder plugin for runtime (must remain after build deps are removed) - G_AGI libheif-plugin-x265 - # Download Immich source local version=$(curl -sSfL 'https://api.github.com/repos/immich-app/immich/releases/latest' | grep -Po '"tag_name": *"\K[^"]+') [[ $version ]] || { version='v2.5.6'; G_DIETPI-NOTIFY 1 "Automatic latest ${aSOFTWARE_NAME[$software_id]} version detection failed. Version \"$version\" will be installed as fallback, but a newer version might be available. Please report this at: https://github.com/MichaIng/DietPi/issues"; } @@ -12019,6 +12016,18 @@ _EOF_ # Prevent JavaScript OOM during build export NODE_OPTIONS='--max-old-space-size=4096' + # Build libheif from source with x265 and de265 encoders enabled + # System libheif1 doesn't have proper x265 encoding support, plugins don't work reliably + G_DIETPI-NOTIFY 2 'Building latest libheif from source with x265 encoder support...' + G_EXEC git clone --depth=1 https://github.com/strukturag/libheif.git + G_EXEC cd libheif + G_EXEC cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DWITH_X265=ON -DWITH_LIBDE265=ON -DWITH_EXAMPLES=OFF + G_EXEC cmake --build build --parallel + G_EXEC cmake --install build + G_EXEC cd "$immich_src" + G_EXEC rm -rf libheif + G_EXEC ldconfig /usr/local/lib + # Build libvips from source for full HEIC support # Sharp 0.34.5+ requires libvips 8.17.3+, but system packages only provide 8.15.1 G_DIETPI-NOTIFY 2 'Building latest libvips from source for HEIC support...' @@ -12041,7 +12050,7 @@ _EOF_ # Remove build-time tools and dependencies G_EXEC rm /usr/local/bin/extism-js /usr/local/bin/wasm-merge /usr/local/bin/wasm-opt - G_AGP git make meson ninja-build pkg-config libglib2.0-dev libexpat1-dev libexif-dev libjpeg-dev libpng-dev libwebp-dev libheif-dev libde265-dev libx265-dev + G_AGP git make cmake meson ninja-build pkg-config libglib2.0-dev libexpat1-dev libexif-dev libjpeg-dev libpng-dev libwebp-dev libde265-dev libx265-dev libheif-plugin-x265 # Deploy server [[ -d '/opt/immich' ]] && G_EXEC rm -R /opt/immich