From c6a210e7c6d4eec25e2ee0c077d3cb430095a8bd Mon Sep 17 00:00:00 2001 From: Juhyung Park Date: Mon, 24 Nov 2025 00:10:16 +0900 Subject: [PATCH] Add HEIF support and instructions Signed-off-by: Juhyung Park --- README.md | 22 +++++++++++++++++++++- install.sh | 16 +++++++++++++++- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4ff12df..5b719fe 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,9 @@ This repository provides instructions and helper scripts to install [Immich](htt * Only the basic CPU configuration is used. Hardware-acceleration such as CUDA is unsupported. In my personal experience, importing about 10K photos on a x86 processor doesn't take an unreasonable amount of time (less than 30 minutes). - * JPEG XL support may differ official Immich due to base-image's dependency differences. + * JPEG XL/RAW support may differ official Immich due to base-image's dependency differences. + + * For HEIF support, see [below](#HEIF-Support). ## 1. Install dependencies @@ -206,3 +208,21 @@ postgres=# \q # Optionally remove dependencies # Review /var/log/apt/history.log and remove packages you've installed ``` + +## HEIF Support + + * Apple devices use HEIF images instead of JPG. + + * Immich supports HEIF but installing it natively requires building [Sharp](https://github.com/lovell/sharp) from source. + + * Building Sharp from source in turn requires the latest `libvips-dev` to be installed. + + * For Ubuntu, see my [arter97/libvips PPA](https://launchpad.net/~arter97/+archive/ubuntu/libvips) to install the latest `libvips`: + +``` bash +sudo add-apt-repository ppa:arter97/libvips +sudo apt install libvips-dev +sudo apt remove libvips*t64 +``` + + * If you installed the latest `libvips-dev`, the install script will detect this automatically and proceed to install Sharp from source. diff --git a/install.sh b/install.sh index 4ad8eb9..c96604c 100755 --- a/install.sh +++ b/install.sh @@ -174,7 +174,21 @@ rm cities500.zip # Install sharp cd $APP -pnpm install sharp +# https://github.com/lovell/sharp/blob/main/src/common.h#L20 +VIPS_LOCAL_VERSION="$(pkg-config --modversion vips || true)" +VIPS_TARGET_VERSION="8.17.3" +if [[ "$(printf '%s\n' $VIPS_TARGET_VERSION $VIPS_LOCAL_VERSION | sort -V | head -n1)" == "$VIPS_LOCAL_VERSION" ]]; then + echo "Local libvips-dev is installed, manually building sharp" + pnpm remove sharp + SHARP_FORCE_GLOBAL_LIBVIPS=1 npm_config_build_from_source=true pnpm add sharp --ignore-scripts=false --allow-build=sharp +else + if [ ! -z "$VIPS_LOCAL_VERSION" ]; then + echo "Local libvips-dev is installed, but it's too out-of-date" + echo "Detected $VIPS_LOCAL_VERSION, but $VIPS_TARGET_VERSION or higher is required" + sleep 5 + fi + pnpm install sharp +fi # Setup upload directory mkdir -p $IMMICH_PATH/upload