From ed2447c6336e5ddcb60faac5e89d2b6e1ce66bda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sat, 11 Oct 2025 09:28:09 -0700 Subject: [PATCH 1/2] immich: fix thumbnail generation for raw photos --- pkgs/by-name/im/immich/package.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/im/immich/package.nix b/pkgs/by-name/im/immich/package.nix index 0c002e42fbf4..5bf139509ae9 100644 --- a/pkgs/by-name/im/immich/package.nix +++ b/pkgs/by-name/im/immich/package.nix @@ -146,6 +146,12 @@ let runHook postInstall ''; }; + + # Without this thumbnail generation for raw photos fails with + # Error: Input file has corrupt header: tiff2vips: samples_per_pixel not a whole number of bytes + vips' = vips.overrideAttrs (prev: { + mesonFlags = prev.mesonFlags ++ [ "-Dtiff=disabled" ]; + }); in stdenv.mkDerivation { pname = "immich"; @@ -182,7 +188,7 @@ stdenv.mkDerivation { pango pixman # Required for sharp - vips + vips' ]; env.SHARP_FORCE_GLOBAL_LIBVIPS = 1; From a6c712b2619f46881462a63b4e5cf2ca04b01d56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sat, 11 Oct 2025 10:22:07 -0700 Subject: [PATCH 2/2] nixos/tests/immich: test thumbnail generation from PEF format This previously failed: https://github.com/NixOS/nixpkgs/issues/450972 --- nixos/tests/web-apps/immich.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/nixos/tests/web-apps/immich.nix b/nixos/tests/web-apps/immich.nix index e9b3c38961fd..fddc681620f1 100644 --- a/nixos/tests/web-apps/immich.nix +++ b/nixos/tests/web-apps/immich.nix @@ -27,6 +27,12 @@ notifications.smtp.transport.password = "/etc/shadow"; }; }; + + # licensed under CC0 1.0: https://github.com/NixOS/nixpkgs/issues/450972#issuecomment-3393545531 + environment.etc.photos.source = pkgs.fetchzip { + url = "https://github.com/user-attachments/files/22865871/IMGP5923.zip"; + hash = "sha256-ux0IG1qCB1s8GKsZp9R0rvwEZxeXm5FnuS9kYstKVmo="; + }; }; testScript = '' @@ -57,6 +63,13 @@ res = machine.succeed("immich server-info") print(res) + with subtest("Test thumbnail generation from PEF format"): + res = machine.succeed("immich upload --json-output /etc/photos/IMGP5923.PEF | tail -n +4") + asset_id = json.loads(res)["newAssets"][0]["id"] + machine.wait_until_succeeds(f""" + curl -fI -X GET -H 'Cookie: immich_access_token={token}' http://localhost:2283/api/assets/{asset_id}/thumbnail + """) + machine.succeed(""" curl -f -X PUT -H 'Cookie: immich_access_token=%s' --json '{ "command": "start" }' http://localhost:2283/api/jobs/backupDatabase """ % token)