perf(preview): decode the max preview at a reduced size with Imagick - #65149
Open
CarlSchwan wants to merge 1 commit into
Open
CarlSchwan wants to merge 1 commit into
CarlSchwan wants to merge 1 commit into
Conversation
CarlSchwan
requested review from
Altahrim,
icewind1991,
provokateurin and
sorbaugh
and removed request for
a team
October 5, 2026 15:05
CarlSchwan
force-pushed
the
carl/preview-imagick-scaled-decode
branch
from
October 5, 2026 15:25
b2f6ef2 to
3347f42
Compare
Small previews like the 64px and 256px ones of the files list and grid view were resized from the fully decoded max preview, a 12 MP image for a camera photo. libjpeg can scale by 1/2, 1/4 or 1/8 while decoding: with Imagick, decoding a 12 MP JPEG this way takes about 30ms instead of about 90ms with GD, and the resize then starts from a 500x380 px image instead of a 4032x3024 px one. Use it when Imagick is available and the requested preview is at most 1/8 of the max preview, otherwise decode the full max preview as before. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Carl Schwan <carl@carlschwan.eu>
CarlSchwan
force-pushed
the
carl/preview-imagick-scaled-decode
branch
from
October 5, 2026 17:45
3347f42 to
b56a6f6
Compare
CarlSchwan
added this pull request to stack #65162
October 6, 2026 07:38
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Small previews like the 64px and 256px ones of the files list and grid view were resized from the fully decoded max preview, a 12 MP image for a camera photo. libjpeg can scale by 1/2, 1/4 or 1/8 while decoding: with Imagick, decoding a 12 MP JPEG this way takes about 30ms instead of about 90ms with GD, and the resize then starts from a 500x380 px image instead of a 4032x3024 px one.
Use it when Imagick is available and the requested preview is at most 1/8 of the max preview, otherwise decode the full max preview as before
Checklist
3. to review, feature component)stable32)AI (if applicable)