On Thu, 17 Oct 2024 11:23:06 GMT, Lukasz Kostyra <[email protected]> wrote:
>> modules/javafx.graphics/src/main/java/com/sun/javafx/iio/ImageStorage.java
>> line 392:
>>
>>> 390: try {
>>> 391: // last fallback, try to see if the file
>>> exists with @1x suffix
>>> 392: String scaled1xName =
>>> ImageTools.getScaledImageName(input, 1);
>>
>> I think this function does not properly handle cases where the input may
>> already have a scale specified.
>>
>> If I want to load `[email protected]` then this function will return
>> `testimg@[email protected]`
>>
>> I'm not sure what is normal here, but I'd think that if a scale was already
>> specified that we shouldn't do any fallback.
>
> This technically translates to the for-loop higher up that tries to fetch
> other scaled versions of an image - if you want to explicitly load
> `[email protected]` it will look for `foo@[email protected]` etc.
>
> Should we just assume that with `@Nx` provided in the name we will only load
> that one specific scale?
I would say so, yes. If the user specifies any `@Nx`, then we only look for
this particular version.
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1598#discussion_r1804615072