Skip to content

Conversation

arunjose696
Copy link
Contributor

@arunjose696 arunjose696 commented Sep 15, 2025

It shall be possible to draw images at a custom zoom or size while maintaining the best achievable quality. To support this, images originating from an SVG source must be rasterized at the required size.

The internal API introduced in this PR enables loading SVGs at custom sizes, allowing images to be drawn at any requested zoom level or resolution, as discussed in in vi-eclipse/Eclipse-Platform#326

Goal It shall be possible to draw images at a custom zoom/size at the best achievable quality. This means either

  • rescaling from the most fitting zoomed version of the image that exists
  • rasterizing the image at the according size from an SVG source

This PR specifically adds the internal API to handle rasterization for images coming from SVG sources.

@laeubi
Copy link
Contributor

laeubi commented Sep 15, 2025

@arunjose696 can we please mirror the (relevant) information in the PR? Its always a bit hard to follow for others what are is discussed if it happens in another repository with a different organization.

@@ -32,4 +32,6 @@ public interface SVGRasterizer {
* the input is not a valid SVG file or cannot be processed.
*/
public ImageData rasterizeSVG(InputStream stream, int zoom) throws IOException;

public ImageData rasterizeSVG(InputStream stream, int width, int height) throws IOException;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add javadoc here, also if there are any limitations (e.g. what happens when size is negative).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added javadoc

Copy link
Contributor

github-actions bot commented Sep 15, 2025

Test Results

0 files   -    546  0 suites   - 546   0s ⏱️ - 32m 16s
0 tests  -  4 431  0 ✅  -  4 414  0 💤  -  17  0 ❌ ±0 
0 runs   - 16 764  0 ✅  - 16 637  0 💤  - 127  0 ❌ ±0 

Results for commit c04bcdf. ± Comparison against base commit 508ad4a.

♻️ This comment has been updated with latest results.

… and width

Adding internal API to SVGRasterizer and simple tests to see if the svgs
are loaded at right sizes by the rasterizer
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.

rasterize the image at the according size from an SVG source
2 participants