Skip to content

Fix blurry Space image previews on HiDPI displays - #336

Closed
gjouret wants to merge 1 commit into
thisisgm:mainfrom
gjouret:fix/quicklook-hidpi-images
Closed

gjouret wants to merge 1 commit into
thisisgm:mainfrom
gjouret:fix/quicklook-hidpi-images

Conversation

@gjouret

@gjouret gjouret commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Opening an image with Space looks soft on a scaled display because Quick Look requests a decode sized in logical pixels. On a 200% display, a 1,000-logical-pixel preview receives roughly 1,000 image pixels for 2,000 physical screen pixels. This was reported on a 5120 × 2160 monitor at scale 2 with Flea 0.3.12.

Multiply the fit decode dimensions by Screen.devicePixelRatio, and apply the same scaling to SVG redraws while zoomed. The existing logical layout and full-resolution raster zoom path remain in use. At scale 2, the fit texture can use approximately four times the memory of the previous under-resolved texture, bounded by source dimensions for raster images.

Update the existing Quick Look zoom checks to expect physical-pixel decode dimensions.

Validation:

  • FLEA_FIXTURE_ROOT=/tmp/flea-sandbox bash tests/quicklook-zoom.sh — passed at default scale.
  • The same suite with QT_SCALE_FACTOR=1.5 and QT_SCALE_FACTOR=2, using separate fixture roots — both passed.
  • Restored the original PreviewImage.qml temporarily and ran the updated suite at scale 2 — failed on fit resolution and both SVG zoom resolution checks; restored the patch afterward.
  • QML parsing with qmlformat, git diff --check, and tools/flea-file-budget — passed (existing budget warnings remain).

The patch was also installed locally; visual confirmation of the resulting sharpness is still pending.

Summary by CodeRabbit

  • Improvements
    • Images in the preview now render at resolutions suited to high-density displays, including raster images and zoomed SVGs, for clearer results.
    • Image fit and layout remain unchanged.

@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4f5d0042-378c-4ca1-a351-08448f7bef4c
📥 Commits

Reviewing files that changed from the base of the PR and between f21789e and a4313f6.

📒 Files selected for processing: 2
  • tests/quicklook-zoom.qml
  • ui/PreviewImage.qml

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

📝 Walkthrough

Image decode target dimensions now include Screen.devicePixelRatio for raster images and zoomed SVGs. Quick Look zoom tests check the updated dimensions. Logical fit geometry remains unchanged.

Changes: Image decode scaling

Layer / File(s) Summary
Scale decode targets and test expectations
ui/PreviewImage.qml, tests/quicklook-zoom.qml
Raster and zoomed SVG decode targets use dimensions scaled by Screen.devicePixelRatio, rounded and clamped to at least 1. The tests check the updated fit-image and zoomed SVG dimensions.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: thisisgm

Merge Risk: ⚪ Minimal · up to a4313

The change requests higher-resolution decode targets for HiDPI previews without changing logical layout. No actionable merge-blocking risk is evident.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: improving image preview sharpness on HiDPI displays.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (2 skipped: 2 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@thisisgm

thisisgm commented Nov 3, 2026

Copy link
Copy Markdown
Owner

Quick Look images decoded at logical size looked soft on HiDPI displays. Quick Look images use the display scale when they are decoded (38dbb02a2c, v0.4.0). Thanks @gjouret! Release.

@thisisgm thisisgm closed this Nov 3, 2026
thisisgm added a commit that referenced this pull request Nov 8, 2026
Its change shipped reimplemented in 0.4.0 (38dbb02), credited by trailer.
This merge records the contributor's own commits; the tree is unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants