RFR: 8306707: Support pluggable image loading via javax.imageio [v9]

Michael Strauß mstrauss at openjdk.org
Wed Oct 30 19:18:12 UTC 2024


On Wed, 30 Oct 2024 18:35:26 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

>> modules/javafx.graphics/src/main/java/com/sun/javafx/iio/javax/XImageLoader.java line 126:
>> 
>>> 124:             int imageHeight = reader.getHeight(imageIndex);
>>> 125:             int[] widthHeight = ImageTools.computeDimensions(
>>> 126:                 (int)(imageWidth * screenPixelScale), (int)(imageHeight * screenPixelScale),
>> 
>> Again is there a possibility of overflow here?
>
> should it be `(int)` (~floor) or `(int)Math.round()` ?

`(int)` is truncating (flooring) the double value, and I think that is the correct thing to do.

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/1593#discussion_r1823243166


More information about the openjfx-dev mailing list