-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix: Image Previews Have Constant Size #2079
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
Fix: Image Previews Have Constant Size #2079
Conversation
austincondiff
commented
Jul 10, 2025
Some images are small. Filing the space would mean a very pixelated image. Ideally there would be a threshold of some kind so smaller images show actual pixels but still are zoom-able.
thecoolwinter
commented
Jul 11, 2025
Some images are small. Filing the space would mean a very pixelated image. Ideally there would be a threshold of some kind so smaller images show actual pixels but still are zoom-able.
I agree, that's annoying. The issue is we can't control the zoom level. (削除) If we could even set the initial zoom level it'd be a different story. (削除ここまで) I just found that the QLPreviewController takes a delegate that lets us do exactly that. I'll see if I can refactor this to use QLPreviewController instead of QLPreviewView and make the changes to set the initial zoom level.
thecoolwinter
commented
Jul 17, 2025
@austincondiff QLPreviewController is only available on iOS so we're back to where we started here. I think the best UX will be to let QLPreviewView decide the size and allow the user to zoom it correctly.
Lancelotbronner
commented
Nov 8, 2025
@austincondiff
QLPreviewControlleris only available on iOS so we're back to where we started here. I think the best UX will be to letQLPreviewViewdecide the size and allow the user to zoom it correctly.
Working a lot with pixelated images, that would be my preference. If my image is small I expect it to be pixelated and can just zoom out, no big deal!
Description
Right now, CodeEdit attempts to display image previews at image's native resolution. This is done by restricting the view's size to the image's size. However, the preview view is scrollable and zoomable. This leads to issues like brought up in #2066 where the image is small.
This change removes the restricted size for image previews. This means they now fill the available editor space by default. They can still be zoomed, and their resolution is still listed in the status bar.
Detailed Changes
ImageFileViewas it was redundant after removing the image size restriction.ifstatement inNonTextFileViewafter removingImageFileView.Related Issues
Checklist
Screenshots
Before, image is displayed at native resolution but has inset scroll bars and doesn't correctly zoom:
Screen.Recording.2025年07月07日.at.3.02.01.PM.mov
With change, image is zoomed to fit width but has correct scrolling and zooming UI and UX:
Screen.Recording.2025年07月07日.at.3.02.20.PM.mov