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"); + } } }