-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(server): optimize person thumbnail generation #7513
Conversation
Deploying immich with Cloudflare Pages
|
Hmm that's weird, it was working well when I tested it. I'll do more testing tomorrow |
7763ba3
to
4410e31
Compare
@alextran1502 Can you confirm if you still have the issue as of the latest commit? I'm wondering if you maybe tried it with an older commit |
I will take a look again and report back |
80c9f29
to
c45e525
Compare
I tried on a slice of my library and reproduced the issue. I think it's because of #3569. |
Can confirm that handling orientation fixed all the bad crops. |
@alextran1502 Could you test this PR when you get a chance? I want to be sure the cropping issues you noticed are fixed now. |
…e-thumbnail-generation
Great work! Thank you for the discovery and the fix! |
Description
Person thumbnails are currently generated by cropping to a buffer and passing this buffer to sharp to resize. This is inefficient:
This PR combines cropping and resizing to the same pipeline for better performance and less compressed thumbnails. Additionally, it uses the original image to generate the thumbnail to further reduce compression artifacts, scaling the bounding box dimensions as needed.
How Has This Been Tested?
I ran facial recognition on all assets and confirmed the person thumbnails are accurately cropped and look normal.
Before:
After: