Repository navigation
fix(editor): keep zoomed previews sharp on Linux - #1960
Open
prosthetiknow wants to merge 2 commits into
Open
prosthetiknow wants to merge 2 commits into
prosthetiknow wants to merge 2 commits into
Conversation
WebKitGTK paints the CSS-scaled preview layer at its fit-to-window size and magnifies it, so zoom showed a stretched copy whatever the render resolution. Once zoom settles, the editor draws the preview in a layer laid out at its zoomed size, outside the scaled content. The stretched copy stays until it loads, and panning still moves the CSS transform. At about 50% zoom and closer, the backend renders the visible area plus a 15% margin at full resolution. A second preview worker with its own preview and GPU texture caches runs these, so whole-frame renders keep theirs and stay at fit size while zoomed. On a GFX100 II, 100% sharpens in about 0.3 s after a one-off build per photo, down from 8 to 15 s. Cached previews record their source file. The transform hash covers adjustments only, so photos with identical edits shared an entry. Fixes CyberTimon#1891
prosthetiknow
force-pushed
the
fix/linux-zoom-sharpness
branch
from
October 19, 2026 19:46
28fc1dc to
666d8ff
Compare
7 of 17 tasks
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.
Description
Fixes #1891, the open report of the bug behind #1160 and #1779. On Linux the editor never shows full detail when zoomed in. The backend renders the full-resolution preview, but WebKitGTK paints the CSS-scaled preview layer at its fit-to-window size and magnifies that bitmap. At 100% the canvas shows a stretched fit-size image, soft or blocky depending on
isMaxZoom. The wgpu renderer has been off on Linux since #1061, so every Linux user takes this path.This keeps zoom sharp on Linux and makes high zoom faster.
Type of Change
Changes Made
ImageCanvasportals an<img>of the current preview into a layer thatEditorplaces under the scaled content. The layer is laid out at the zoomed size with noscale(), so the engine paints it at screen resolution. Panning and zooming still move the CSS transform. The stretched SVG image stays until the sharp one loads, so thumbnails and loading look as before. Masks, crop and other overlays draw above it unchanged. It only applies when the wgpu renderer is off.regionOnlyflag onapply_adjustments. A second preview worker serves these, with its ownCachedPreviewandGpuImageCacheslots. Region and whole-frame renders no longer evict each other's caches or drop each other's queued jobs. Region renders reuse the interactive ROI path at full quality and skip analytics. Whole-frame renders stay at fit size while zoomed, so the histogram still updates.CachedPreviewrecords the image path. The transform hash covers adjustments only, so a newly loaded photo with identical edits could reuse the previous photo's preview.load_imageandclear_image_cachesclear the region slots too.prepareAdjustmentsPayload, like the other preview requests.decodePatchResponseinuseImageProcessing.tsreplaces the inline patch-header parsing inexecuteApplyAdjustments.Screenshots/Videos
Before:

After:

Testing
Test Configuration:
With "Render at native DPI" on, reaching full detail at 100% used to take four whole-frame renders over about 15 s, the last at 11648×8736. A region render now takes 250 to 450 ms, after a one-off cache build per photo.
Not tested on macOS or Windows. Both changes stay off while the wgpu renderer is active.
Checklist
Additional Notes
This builds on earlier reports and attempts.
Related
clear_preview_slothelper. Its Linux viewer places JPEGs with a CSS transform, so the sharp layer would help there too.AI Disclaimer:
Please state the involvement of AI in this PR: