On Wed, 26 May 2021 16:36:24 GMT, Michael Strauß <mstra...@openjdk.org> wrote:
>> This PR adds support for loading images from [inline data >> URIs](https://en.wikipedia.org/wiki/Data_URI_scheme), which is also widely >> supported by web browsers. This enables developers to package small images >> in CSS files, rather than separately deploying the images alongside the CSS >> file. > > Michael Strauß has updated the pull request with a new target base due to a > merge or a rebase. The pull request now contains 15 commits: > > - Merge branch 'master' into feature/image-datauri > > # Conflicts: > # > modules/javafx.graphics/src/test/java/test/com/sun/javafx/iio/ImageStorageTest.java > - Accept regular file paths, change javadoc > - Merge branch 'openjdk:master' into feature/image-datauri > - Rename DataURI.isValidURI > - Reverted a change > - Allow leading and trailing whitespace in data URI > - Removed test > - Changed data URI detection > - Merge branch 'master' into feature/image-datauri > - Moved test > - ... and 5 more: > https://git.openjdk.java.net/jfx/compare/7b7050c4...315523c5 modules/javafx.graphics/src/main/java/com/sun/javafx/css/StyleManager.java line 776: > 774: } else { > 775: logger.warning("Error loading image: > " + url); > 776: } So if I understand this correctly, an Image is first loaded via the standard mechanism, and if that fails for any reason (`image.isError()`) a second attempt is made through `DataURI` ? Would it not be better to register a new protocol so `new Image` would just succeed for data uri's ? ------------- PR: https://git.openjdk.java.net/jfx/pull/508