-
Notifications
You must be signed in to change notification settings - Fork 185
Add internal API in SVGrasterizer to rasterize images at given height and width #2514
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
Add internal API in SVGrasterizer to rasterize images at given height and width #2514
Conversation
|
@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. |
| */ | ||
| public ImageData rasterizeSVG(InputStream stream, int zoom) throws IOException; | ||
|
|
||
| public ImageData rasterizeSVG(InputStream stream, int width, int height) throws IOException; |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added javadoc
Test Results 118 files ±0 118 suites ±0 12m 8s ⏱️ + 1m 25s For more details on these failures, see this check. Results for commit 45dfe6c. ± Comparison against base commit 5d2665d. ♻️ This comment has been updated with latest results. |
663817f to
c04bcdf
Compare
c04bcdf to
a0f0f0b
Compare
|
@arunjose696 can you please fix the compilation errors? |
74d2f86 to
2f57b89
Compare
HeikoKlare
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, the change looks good. I have rather minor comments.
bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/SVGRasterizer.java
Outdated
Show resolved
Hide resolved
tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/JSVGRasterizerTest.java
Show resolved
Hide resolved
tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/JSVGRasterizerTest.java
Outdated
Show resolved
Hide resolved
e56c37d to
f916385
Compare
HeikoKlare
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks almost good to me. I just have minor comments left. Please check the formatting of the code again (I found some place where it seems inaccurate).
bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/SVGRasterizer.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/SVGRasterizer.java
Outdated
Show resolved
Hide resolved
tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/JSVGRasterizerTest.java
Outdated
Show resolved
Hide resolved
… and width Adding internal API to SVGRasterizer and simple tests to see if the svgs are loaded at right sizes by the rasterizer
f916385 to
45dfe6c
Compare
Fixed formatting |
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
This PR specifically adds the internal API to handle rasterization for images coming from SVG sources.