Re: RFR: 8329098: Support "@1x" image naming convention as fallback [v4]

2024-10-22 Thread Kevin Rushforth
On Mon, 21 Oct 2024 11:28:23 GMT, Lukasz Kostyra wrote: >> This PR adds a title-mentioned fallback to `ImageStorage.java` and a test >> for that specific scenario. >> >> In `ImageStorage.loadAll()` we still prefer the Image path that was provided >> by the user, but if it is missing we will no

Re: RFR: 8329098: Support "@1x" image naming convention as fallback [v4]

2024-10-21 Thread John Hendrikx
On Mon, 21 Oct 2024 11:28:23 GMT, Lukasz Kostyra wrote: >> This PR adds a title-mentioned fallback to `ImageStorage.java` and a test >> for that specific scenario. >> >> In `ImageStorage.loadAll()` we still prefer the Image path that was provided >> by the user, but if it is missing we will no

Re: RFR: 8329098: Support "@1x" image naming convention as fallback [v4]

2024-10-21 Thread Michael Strauß
On Mon, 21 Oct 2024 11:28:23 GMT, Lukasz Kostyra wrote: >> This PR adds a title-mentioned fallback to `ImageStorage.java` and a test >> for that specific scenario. >> >> In `ImageStorage.loadAll()` we still prefer the Image path that was provided >> by the user, but if it is missing we will no

Re: RFR: 8329098: Support "@1x" image naming convention as fallback [v4]

2024-10-21 Thread Lukasz Kostyra
> This PR adds a title-mentioned fallback to `ImageStorage.java` and a test for > that specific scenario. > > In `ImageStorage.loadAll()` we still prefer the Image path that was provided > by the user, but if it is missing we will now try to add a `@1x` suffix to > Image name and give it one la

Re: RFR: 8329098: Support "@1x" image naming convention as fallback [v2]

2024-10-21 Thread Lukasz Kostyra
On Sat, 19 Oct 2024 15:47:42 GMT, John Hendrikx wrote: >> I would think that this is acceptable, since that's the exception message >> that we expect to see (if the `@1x` version also can't be found). > > I think the call stack being different is fine; call stacks are there for > developers to

Re: RFR: 8329098: Support "@1x" image naming convention as fallback [v2]

2024-10-19 Thread John Hendrikx
On Fri, 18 Oct 2024 15:09:27 GMT, Michael Strauß wrote: >> This would technically create an ambiguity in the call stack (I checked and >> it points at in this case L385 instead of where the (re)throw actually >> happened) but if it's not a problem I can change it. > > I would think that this is

Re: RFR: 8329098: Support "@1x" image naming convention as fallback [v2]

2024-10-18 Thread Michael Strauß
On Fri, 18 Oct 2024 14:53:52 GMT, Lukasz Kostyra wrote: >> This is a bit minor, but what do you think about storing the previous >> exception in L385, and then re-throwing it? This is most likely exceedingly >> rare, but it might be possible that the reason why the previous call to >> `createI

Re: RFR: 8329098: Support "@1x" image naming convention as fallback [v2]

2024-10-18 Thread Lukasz Kostyra
On Fri, 18 Oct 2024 14:19:12 GMT, Michael Strauß wrote: >> That is technically solved by re-calling `createInputStream(input)` like >> @mstr2 suggested to get a correct exception with valid message, so I will go >> with that approach. > > This is a bit minor, but what do you think about storing

Re: RFR: 8329098: Support "@1x" image naming convention as fallback [v2]

2024-10-18 Thread Michael Strauß
On Fri, 18 Oct 2024 13:56:04 GMT, Lukasz Kostyra wrote: >> modules/javafx.graphics/src/main/java/com/sun/javafx/iio/ImageStorage.java >> line 385: >> >>> 383: try { >>> 384: theStream = >>> ImageTools.createInputStream(input); >>> 385:

Re: RFR: 8329098: Support "@1x" image naming convention as fallback [v3]

2024-10-18 Thread Lukasz Kostyra
> This PR adds a title-mentioned fallback to `ImageStorage.java` and a test for > that specific scenario. > > In `ImageStorage.loadAll()` we still prefer the Image path that was provided > by the user, but if it is missing we will now try to add a `@1x` suffix to > Image name and give it one la

Re: RFR: 8329098: Support "@1x" image naming convention as fallback [v2]

2024-10-18 Thread Lukasz Kostyra
On Wed, 16 Oct 2024 13:14:01 GMT, John Hendrikx wrote: >> Lukasz Kostyra has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Review fixes >> >> - Change exception message in loadAll() to include original resource >> path >> - Add

Re: RFR: 8329098: Support "@1x" image naming convention as fallback [v2]

2024-10-17 Thread Lukasz Kostyra
On Thu, 17 Oct 2024 12:06:39 GMT, Kevin Rushforth wrote: >> I would say so, yes. If the user specifies any `@Nx`, then we only look for >> this particular version. > > Probably, but this is out of scope for this PR / JBS bug. Please file a > follow-up bug. Filed [JDK-8342530](https://bugs.open

Re: RFR: 8329098: Support "@1x" image naming convention as fallback [v2]

2024-10-17 Thread Kevin Rushforth
On Thu, 17 Oct 2024 11:44:33 GMT, Michael Strauß wrote: >> 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 >> `f...@1x.png` it will look for `foo@1...@2x.png` etc. >> >> Should we just assume that w

Re: RFR: 8329098: Support "@1x" image naming convention as fallback [v2]

2024-10-17 Thread Michael Strauß
On Thu, 17 Oct 2024 11:23:06 GMT, Lukasz Kostyra 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

Re: RFR: 8329098: Support "@1x" image naming convention as fallback [v2]

2024-10-17 Thread Lukasz Kostyra
On Wed, 16 Oct 2024 13:08:57 GMT, John Hendrikx wrote: >> Lukasz Kostyra has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Review fixes >> >> - Change exception message in loadAll() to include original resource >> path >> - Add

Re: RFR: 8329098: Support "@1x" image naming convention as fallback [v2]

2024-10-16 Thread Michael Strauß
On Wed, 16 Oct 2024 11:30:26 GMT, Lukasz Kostyra wrote: >> This PR adds a title-mentioned fallback to `ImageStorage.java` and a test >> for that specific scenario. >> >> In `ImageStorage.loadAll()` we still prefer the Image path that was provided >> by the user, but if it is missing we will no

Re: RFR: 8329098: Support "@1x" image naming convention as fallback [v2]

2024-10-16 Thread John Hendrikx
On Wed, 16 Oct 2024 11:30:26 GMT, Lukasz Kostyra wrote: >> This PR adds a title-mentioned fallback to `ImageStorage.java` and a test >> for that specific scenario. >> >> In `ImageStorage.loadAll()` we still prefer the Image path that was provided >> by the user, but if it is missing we will no

Re: RFR: 8329098: Support "@1x" image naming convention as fallback [v2]

2024-10-16 Thread Lukasz Kostyra
> This PR adds a title-mentioned fallback to `ImageStorage.java` and a test for > that specific scenario. > > In `ImageStorage.loadAll()` we still prefer the Image path that was provided > by the user, but if it is missing we will now try to add a `@1x` suffix to > Image name and give it one la

Re: RFR: 8329098: Support "@1x" image naming convention as fallback [v2]

2024-10-16 Thread Lukasz Kostyra
On Mon, 14 Oct 2024 23:58:46 GMT, Kevin Rushforth wrote: >> Lukasz Kostyra has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Review fixes >> >> - Change exception message in loadAll() to include original resource >> path >> - Ad

Re: RFR: 8329098: Support "@1x" image naming convention as fallback

2024-10-16 Thread Lukasz Kostyra
On Mon, 14 Oct 2024 23:48:32 GMT, Kevin Rushforth wrote: >> This PR adds a title-mentioned fallback to `ImageStorage.java` and a test >> for that specific scenario. >> >> In `ImageStorage.loadAll()` we still prefer the Image path that was provided >> by the user, but if it is missing we will n

Re: RFR: 8329098: Support "@1x" image naming convention as fallback

2024-10-14 Thread Kevin Rushforth
On Fri, 11 Oct 2024 10:57:34 GMT, Lukasz Kostyra wrote: > This PR adds a title-mentioned fallback to `ImageStorage.java` and a test for > that specific scenario. > > In `ImageStorage.loadAll()` we still prefer the Image path that was provided > by the user, but if it is missing we will now try

RFR: 8329098: Support "@1x" image naming convention as fallback

2024-10-11 Thread Lukasz Kostyra
This PR adds a title-mentioned fallback to `ImageStorage.java` and a test for that specific scenario. In `ImageStorage.loadAll()` we still prefer the Image path that was provided by the user, but if it is missing we will now try to add a `@1x` suffix to Image name and give it one last try. Add