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. |
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved issues can block the UI when opening remote images, produce undersized cursors on fractional-DPI displays, and leak native image handles when cursor creation fails.
3 open issues
1 resolved since last review
Review effort: Balanced
c94b015 to
53f2d9a
Compare
|
This pull request changes some projects for the first time in this development cycle. An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch. Git patchFurther information are available in Common Build Issues - Missing version increments. |
f49006e to
ed6d79b
Compare
ed6d79b to
2b38ed9
Compare
|
Hi, All the comments are fixed now. |
| public void testInputWithNullPathShowsErrorPart() throws Exception { | ||
| // init() rejects the input: the workbench shows its error part instead | ||
| IEditorPart editor = page.openEditor(new PathInput(null), ImageViewerEditor.IMAGE_VIEWER_EDITOR_ID); | ||
| try { | ||
| assertEquals("org.eclipse.ui.internal.ErrorEditorPart", editor.getClass().getName()); | ||
| } finally { | ||
| // the error part has a different input, so tearDown() cannot find it | ||
| page.closeEditor(editor, false); | ||
| } | ||
| } |


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.