Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebP parsing is broken on latest version #265

Closed
rzam opened this issue Apr 2, 2023 · 2 comments
Closed

WebP parsing is broken on latest version #265

rzam opened this issue Apr 2, 2023 · 2 comments

Comments

@rzam
Copy link

rzam commented Apr 2, 2023

After upgrading from version 4.0.33 to 4.0.34, the parsing of WebP files seems to be broken.

Gradle:

dependencies {
    implementation("com.sksamuel.scrimage:scrimage-core:4.0.34")
    implementation("com.sksamuel.scrimage:scrimage-webp:4.0.34")
}

Code:

public static void main(String[] args) throws IOException {
    ImmutableImage image = ImmutableImage.loader().fromFile(new File("example.webp"));
    System.out.println(image.width);
}

Result:

Exception in thread "main" java.util.ServiceConfigurationError: com.sksamuel.scrimage.nio.ImageReader: Provider com.sksamuel.scrimage.webp.WebpImageReader could not be instantiated
[...]
	at com.sksamuel.scrimage.nio.ImageReaders.detectReaders(ImageReaders.java:26)
	at com.sksamuel.scrimage.nio.ImageReaders.detectReaders(ImageReaders.java:22)
	at com.sksamuel.scrimage.nio.ImageReaders.<clinit>(ImageReaders.java:19)
	at com.sksamuel.scrimage.nio.ImmutableImageLoader.load(ImmutableImageLoader.java:137)
	at com.sksamuel.scrimage.nio.ImmutableImageLoader.fromFile(ImmutableImageLoader.java:104)
Caused by: java.lang.ExceptionInInitializerError
	at com.sksamuel.scrimage.webp.WebpImageReader.<init>(WebpImageReader.java:11)
[...]
Caused by: java.lang.RuntimeException: java.io.IOException: Could not locate webp binary at [/webp_binaries/dwebp, /webp_binaries/window/dwebp, /webp_binaries/windows/dwebp, /dist_webp_binaries/libwebp-1.3.0-windows-x64/bin/dwebp]
	at com.sksamuel.scrimage.webp.DWebpHandler.<clinit>(DWebpHandler.java:20)
[...]
Caused by: java.io.IOException: Could not locate webp binary at [/webp_binaries/dwebp, /webp_binaries/window/dwebp, /webp_binaries/windows/dwebp, /dist_webp_binaries/libwebp-1.3.0-windows-x64/bin/dwebp]
	at com.sksamuel.scrimage.webp.WebpHandler.installBinary(WebpHandler.java:40)
	at com.sksamuel.scrimage.webp.DWebpHandler.installDWebp(DWebpHandler.java:35)
	at com.sksamuel.scrimage.webp.DWebpHandler.<clinit>(DWebpHandler.java:18)

The same code works as expected on version 4.0.33.

Tested on Windows using OpenJDK8/11/17 and GraalVM17.

@BreninSul
Copy link

The same problem on windows

@sksamuel
Copy link
Owner

Fixed in 4.0.36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants