From ee943ef3af20d5741e7d7ba2fb2a4882b0700b1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Kwiecin=CC=81ski?= Date: Mon, 19 Jun 2023 20:21:38 +0200 Subject: [PATCH 1/2] Flush after write --- .../src/main/java/com/luciad/imageio/webp/WebPWriter.java | 1 + 1 file changed, 1 insertion(+) diff --git a/webp-imageio/src/main/java/com/luciad/imageio/webp/WebPWriter.java b/webp-imageio/src/main/java/com/luciad/imageio/webp/WebPWriter.java index 257de97..12c85e0 100644 --- a/webp-imageio/src/main/java/com/luciad/imageio/webp/WebPWriter.java +++ b/webp-imageio/src/main/java/com/luciad/imageio/webp/WebPWriter.java @@ -71,6 +71,7 @@ public void write(IIOMetadata streamMetadata, IIOImage image, ImageWriteParam pa byte[] encodedData = encode(writeParam.getEncoderOptions(), ri); output.write(encodedData); + output.flush(); } private static byte[] encode(WebPEncoderOptions aOptions, RenderedImage aImage) throws IOException { From 84a3c97c9cc33b4c73ab1187b6cca5ef81e52244 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Kwiecin=CC=81ski?= Date: Mon, 19 Jun 2023 20:21:50 +0200 Subject: [PATCH 2/2] Add extra debug logs --- .../com/luciad/imageio/webp/internal/NativeLoaderTest.kt | 6 +++++- .../kotlin/com/luciad/imageio/webp/internal/OsInfoTest.kt | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/webp-imageio/src/test/kotlin/com/luciad/imageio/webp/internal/NativeLoaderTest.kt b/webp-imageio/src/test/kotlin/com/luciad/imageio/webp/internal/NativeLoaderTest.kt index e936241..cae2224 100644 --- a/webp-imageio/src/test/kotlin/com/luciad/imageio/webp/internal/NativeLoaderTest.kt +++ b/webp-imageio/src/test/kotlin/com/luciad/imageio/webp/internal/NativeLoaderTest.kt @@ -4,12 +4,15 @@ import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.AfterEach import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test +import java.util.logging.Logger class NativeLoaderTest { + private val log = Logger.getLogger(NativeLoaderTest::class.java.name) + @BeforeEach fun setUp() { - NativeLoader.initialize() + check(NativeLoader.initialize()) } @AfterEach @@ -19,6 +22,7 @@ class NativeLoaderTest { @Test fun checkVersion() { + log.info("Native version is: ${NativeLoader.getVersion()}") assertThat(NativeLoader.getVersion()).isNotEqualTo("unknown") } } diff --git a/webp-imageio/src/test/kotlin/com/luciad/imageio/webp/internal/OsInfoTest.kt b/webp-imageio/src/test/kotlin/com/luciad/imageio/webp/internal/OsInfoTest.kt index 1b42cf6..af96c17 100644 --- a/webp-imageio/src/test/kotlin/com/luciad/imageio/webp/internal/OsInfoTest.kt +++ b/webp-imageio/src/test/kotlin/com/luciad/imageio/webp/internal/OsInfoTest.kt @@ -2,11 +2,15 @@ package com.luciad.imageio.webp.internal import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test +import java.util.logging.Logger class OsInfoTest { + private val log = Logger.getLogger(OsInfoTest::class.java.name) + @Test fun smokeTest() { + log.info("Native lib folder path for current OS is: ${OSInfo.getNativeLibFolderPathForCurrentOS()}") assertThat(OSInfo.getNativeLibFolderPathForCurrentOS()).isNotEqualTo("/") } }