From 39f944f7c7176b513c8247f2f68b30cf8377f4d1 Mon Sep 17 00:00:00 2001 From: CGDogan <126820728+CGDogan@users.noreply.github.com> Date: Mon, 28 Aug 2023 11:23:54 +0100 Subject: [PATCH] Throw error when cannot load library --- .../src/loci/formats/services/JPEGTurboServiceImpl.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/formats-bsd/src/loci/formats/services/JPEGTurboServiceImpl.java b/components/formats-bsd/src/loci/formats/services/JPEGTurboServiceImpl.java index 49f82deff58..3231da2686b 100644 --- a/components/formats-bsd/src/loci/formats/services/JPEGTurboServiceImpl.java +++ b/components/formats-bsd/src/loci/formats/services/JPEGTurboServiceImpl.java @@ -105,8 +105,10 @@ public JPEGTurboServiceImpl() { logger = Logger.getLogger(NATIVE_LIB_CLASS); logger.setLevel(Level.SEVERE); if (!libraryLoaded) { - NativeLibraryUtil.loadNativeLibrary(TJ.class, "turbojpeg"); - libraryLoaded = true; + libraryLoaded = NativeLibraryUtil.loadNativeLibrary(TJ.class, "turbojpeg"); + if (!libraryLoaded) { + throw new RuntimeException("TurboJPEG could not be loaded"); + } } }