immich icon indicating copy to clipboard operation
immich copied to clipboard

fix(server): include metadata with thumbnails

Open uhthomas opened this issue 11 months ago • 6 comments

Include metadata with thumbnails, including a "web-friendly sRGB ICC profile".

https://sharp.pixelplumbing.com/api-output#withmetadata

Fixes: #3136

uhthomas avatar Jul 08 '23 22:07 uhthomas

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
immich ⬜️ Ignored (Inspect) Jul 8, 2023 11:17pm

vercel[bot] avatar Jul 08 '23 22:07 vercel[bot]

Hello, how have this been tested?

alextran1502 avatar Jul 09 '23 02:07 alextran1502

Hello, how have this been tested?

Still testing, which is why it's a draft PR. Having some trouble with it as the images are still dull.

uhthomas avatar Jul 09 '23 20:07 uhthomas

http://www.gballard.net/psd/go_live_page_profile/embeddedJPEGprofiles.html explains what I'm seeing quite well. I think we have to get the correct colour profile and convert it to srgb. Looking into this now.

uhthomas avatar Jul 09 '23 21:07 uhthomas

Given https://github.com/lovell/sharp/pull/2271#issuecomment-659414394, I'm not sure sharp actually supports this. I've tested a few variations of things and sharp will either produce an srgb image with muted colours, or preserve the Adobe RGB ICC profile which isn't what we want. Preservation is useless as browsers still render the image with muted colours.

uhthomas avatar Jul 09 '23 22:07 uhthomas

I have made a bit of progress. I can actually convert an AdobeRGB image to sRGB successfully with imagemagick.

❯ convert _DSC3256.jpg -profile /usr/share/color/icc/colord/AdobeRGB1998.icc -profile /usr/share/color/icc/colord/sRGB.icc out.jpg

Which produces two identical files (?) out-0.jpg and out-1.jpg. The colour profiles are included in the system automatically.

❯ paru -Qo /usr/share/color/icc/colord/AdobeRGB1998.icc
/usr/share/color/icc/colord/AdobeRGB1998.icc is owned by colord 1.4.6-1

So now to figure out a more elegant way of doing this and understand if sharp can too.

uhthomas avatar Jul 11 '23 22:07 uhthomas

Superseded by #3658

jrasm91 avatar Sep 27 '23 20:09 jrasm91