Warning
This plugin is designed to be used ONLY with JavaFX fork AetherJFX. Attempting to use it with standard JavaFX will lead to an exception!
WebP image decoding plugin for AetherJFX
Based on SimpleWEBP and integrates into JavaFX's ImageIO
(IIO
) without bytecode manipulations
Important
This plugin written in pure Java, don't require any native libraries and DOES NOT support Lossless and Animated WebP!
Define custom Gradle ivy repository in repositories
block:
repositories {
//...your repositories
def github = ivy {
url 'https://github.com/'
patternLayout {
artifact '/[organisation]/[module]/releases/download/[revision]/[artifact].[ext]'
}
metadataSources { artifact() }
}
exclusiveContent {
forRepositories(github)
filter { includeGroup("0xD3ADCODE") }
}
}
Add dependency into dependencies
block:
dependencies {
//...your dependencies
implementation("0xD3ADCODE:AetherJFX-ImageDecoder-SimpleWebP:{version}") {
artifact {
name = 'AetherJFX-ImageDecoder-SimpleWebP-{version}'
type = 'jar'
}
}
}
Replace {version}
with latest Release tag (eg, v1.0
)
Register plugin as soon as possible (before JavaFX Toolkit start) with just one line of code:
SimpleWEBPLoader.register();
After that all WebP images will be decoded using newly installed decoder directly into JavaFX's Image
To properly build jar
by yourself, clone repository and create gradle.properties
file with:
AETHER_JFX_SDK_PATH = <path to unpacked AetherJFX SDK folder>
Google for WebP decoder
burningtnt for SimpleWEBP WebP decoder/encoder implementation for Java