Pluggable image loading and frame size
mkpaz
quizynox at gmail.com
Mon Jul 14 13:20:26 UTC 2025
Hello,
I'm testing the new pluggable image API with SVG and noticed one thing.
Since SVG is a scalable vector format, it can be rendered at an arbitrary size.
For this purpose, we need to know the frame (pane) size and scale the image accordingly while rendering.
As I understand, ImageReadParam is used to pass the frame size to the image reader.
public class ImageReadParam extends IIOParam { /** * Returns {@code
true} if this reader allows the source image to be rendered at an *
arbitrary size as part of the decoding process ... */ public boolean
canSetSourceRenderSize() { return canSetSourceRenderSize; } }
But when I set canSetSourceRenderSize to true to activate this, I don't get the client frame size.
Instead, I get the actual image size, which the reader already knows since it implements the getWidth() and getHeight() methods.
I read the code and came across this:
https://github.com/openjdk/jfx/blob/master/modules/javafx.graphics/src/main/java/com/sun/javafx/iio/java2d/J2DImageLoader.java#L122
Why does the image loader use the reader's width and height in both branches?
Shouldn't the loader provide the frame size when canSetSourceRenderSize returns true?
Maybe I'm looking for something that isn't supported? Yet?
Best regards.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/openjfx-dev/attachments/20250714/c07727fe/attachment.htm>
More information about the openjfx-dev
mailing list