Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved defects can close the viewer without opening a browser, steal focus, hide thin images, block the UI during path resolution, and leak a temporary image resource.
5 open issues
What changed in this PR
Adds a dedicated Image Viewer editor to Eclipse’s internal browser bundle, making image zooming available directly in editor tabs while retaining the browser as an alternative and fallback.
Changes:
- Adds fit-to-window, click and wheel zoom, focal-point navigation, and animated GIF playback.
- Introduces background image decoding, largest-frame selection for ICO/TIFF files, and browser routing for SVGs and loading failures.
- Registers image associations, adds localized labels, and covers zoom arithmetic and editor loading with tests.
| File | Description |
|---|---|
tests/org.eclipse.ui.tests.browser/src/org/eclipse/ui/tests/browser/internal/ImageZoomModelTest.java |
Tests zoom levels, fit calculations, and focal-point arithmetic. |
tests/org.eclipse.ui.tests.browser/src/org/eclipse/ui/tests/browser/internal/ImageViewerEditorTestCase.java |
Tests image loading and browser fallback paths. |
tests/org.eclipse.ui.tests.browser/src/org/eclipse/ui/tests/browser/internal/AllTests.java |
Registers the new test classes. |
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/Messages.properties |
Adds localized viewer actions and loading/error messages. |
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/Messages.java |
Exposes the new localized message fields. |
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/ImageZoomModel.java |
Implements zoom state and coordinate calculations. |
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/ImageZoomCanvas.java |
Implements rendering, navigation, cursors, and GIF animation. |
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/ImageViewerEditor.java |
Manages asynchronous loading, editor lifecycle, and browser fallback. |
bundles/org.eclipse.ui.browser/plugin.xml |
Registers the default image editor and expands image extensions. |
bundles/org.eclipse.ui.browser/plugin.properties |
Adds the Image Viewer editor label. |
Review effort: Balanced
e70d95b to
6eacf02
Compare
|
All the comments are fixed now. |
There was a problem hiding this comment.
🟡 Changes recommended
Fallback handling can close the image viewer without showing the image or a local error when the path is null or browser initialization fails, and the null-path test throws before reaching its assertion.
3 open issues
5 resolved since last review
Review effort: Balanced
|
The icon appears like this for me in Mac. Can you check this? o11.mov |
|
Also in Mac we can zoom in zoom out by placing two fingers on the trackpad and spreading them apart, which doesn't work in this scenario. Would it be possible to check that as well? |
Thanks alot @elsazac for checking on mac, let me check further. |
6eacf02 to
e8ee5fb
Compare
Added an SWT.Gesture listener. GESTURE_MAGNIFY zooms to the scale at gesture start times magnification, around the fingers. |
e8ee5fb to
c94b015
Compare
|
Hi, I've pushed an update addressing the recent feedback and platform-specific cursor improvements. |

Add support for image zooming inside editor
Summary
Adds an Image Viewer (
ImageViewerEditor) as the default editor for common image formats (png,jpg,jpeg,gif,bmp,ico,svg,tif,tiff). It provides interactive zoom/pan controls, trackpad pinch gestures, animated GIF playback, and graceful fallback to the browser editor when needed.What's Changed
Interactive Zoom & Pan:
+and-with smooth alpha transparency across Windows, macOS, and Linux.Context Menu Actions:
Format & Playback Support:
Safe Background Loading:
Before
Opening an image displays a static view with a standard arrow cursor and no zoom capabilities.

After
Opening an image shows a magnifier cursor ready to zoom:

Zooming in with clicks (magnifier shows

+):Zooming out with Ctrl+click (magnifier switches to

-):Verification
ImageZoomModelTestcovering zoom steps, limits, and focal point calculations.ImageViewerEditorTestcovering valid images, invalid/empty files, null path resolution, and SVG redirection.