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

Lukasz Kostyra lkostyra at openjdk.org
Wed Oct 16 11:30:26 UTC 2024


> 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.
> 
> Added test includes a binary file `checkers at 1x.png`. This was added to differentiate it from the collection of `checker.png` files and their higher scale variants, but it is a direct copy of already existing `checker.png` test resource, just with a different name and suffix. Test should fail without a change in `ImageStorage.java` and pass with it.

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 a test case to ImageStorageTest checking if we load a correct
    resource when both <res> and <res>@1x are present

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

Changes:
  - all: https://git.openjdk.org/jfx/pull/1598/files
  - new: https://git.openjdk.org/jfx/pull/1598/files/fd9e877d..9e46931e

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jfx&pr=1598&range=01
 - incr: https://webrevs.openjdk.org/?repo=jfx&pr=1598&range=00-01

  Stats: 31 lines in 4 files changed: 28 ins; 0 del; 3 mod
  Patch: https://git.openjdk.org/jfx/pull/1598.diff
  Fetch: git fetch https://git.openjdk.org/jfx.git pull/1598/head:pull/1598

PR: https://git.openjdk.org/jfx/pull/1598


More information about the openjfx-dev mailing list