immich
immich copied to clipboard
fix(server): include metadata with thumbnails
Include metadata with thumbnails, including a "web-friendly sRGB ICC profile".
https://sharp.pixelplumbing.com/api-output#withmetadata
Fixes: #3136
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 |
Hello, how have this been tested?
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.
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.
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.
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.
Superseded by #3658