diff --git a/Core/src/org/sleuthkit/autopsy/core/Installer.java b/Core/src/org/sleuthkit/autopsy/core/Installer.java index 7411377733..c7ac86887f 100644 --- a/Core/src/org/sleuthkit/autopsy/core/Installer.java +++ b/Core/src/org/sleuthkit/autopsy/core/Installer.java @@ -51,6 +51,7 @@ import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil; import org.sleuthkit.autopsy.coreutils.ModuleSettings; import org.sleuthkit.autopsy.coreutils.PlatformUtil; import org.sleuthkit.autopsy.modules.filetypeid.FileTypeDetector; +import org.sleuthkit.autopsy.modules.pictureanalyzer.impls.HeifJNI; import org.sleuthkit.autopsy.python.JythonModuleLoader; import org.sleuthkit.autopsy.texttranslation.TextTranslationService; diff --git a/Core/src/org/sleuthkit/autopsy/modules/pictureanalyzer/impls/HEICProcessor.java b/Core/src/org/sleuthkit/autopsy/modules/pictureanalyzer/impls/HEICProcessor.java index e67bb5f130..d88a7b8134 100755 --- a/Core/src/org/sleuthkit/autopsy/modules/pictureanalyzer/impls/HEICProcessor.java +++ b/Core/src/org/sleuthkit/autopsy/modules/pictureanalyzer/impls/HEICProcessor.java @@ -80,8 +80,8 @@ public class HEICProcessor implements PictureProcessor { public HEICProcessor() { HeifJNI heifJNI; try { - heifJNI = new HeifJNI(); - } catch (Exception ex) { + heifJNI = HeifJNI.getInstance(); + } catch (UnsatisfiedLinkError ex) { logger.log(Level.SEVERE, "libheif native dependencies not found. HEIC functionality will be automatically disabled.", ex); heifJNI = null; } diff --git a/Core/src/org/sleuthkit/autopsy/modules/pictureanalyzer/impls/HeifJNI.java b/Core/src/org/sleuthkit/autopsy/modules/pictureanalyzer/impls/HeifJNI.java index e45bb14922..6df065edc7 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/pictureanalyzer/impls/HeifJNI.java +++ b/Core/src/org/sleuthkit/autopsy/modules/pictureanalyzer/impls/HeifJNI.java @@ -20,18 +20,25 @@ package org.sleuthkit.autopsy.modules.pictureanalyzer.impls; /** * - * Interop with libheif dll's. + * Interop with libheif native dependencies. */ public class HeifJNI { -// static { -// System.load("C:\\Users\\gregd\\Documents\\Source\\heif_convert_test\\HeifConvertTestJNI\\dist\\Release\\libx265.dll"); -// System.load("C:\\Users\\gregd\\Documents\\Source\\heif_convert_test\\HeifConvertTestJNI\\dist\\Release\\libde265.dll"); -// System.load("C:\\Users\\gregd\\Documents\\Source\\heif_convert_test\\HeifConvertTestJNI\\dist\\Release\\heif.dll"); -// System.load("C:\\Users\\gregd\\Documents\\Source\\heif_convert_test\\HeifConvertTestJNI\\dist\\Release\\jpeg62.dll"); -// System.load("C:\\Users\\gregd\\Documents\\Source\\heif_convert_test\\HeifConvertTestJNI\\dist\\Release\\heif-convert.dll"); -// -// } + private static HeifJNI instance = null; + + public static HeifJNI getInstance() throws UnsatisfiedLinkError { + if (instance == null) { + System.loadLibrary("libx265"); + System.loadLibrary("libde265"); + System.loadLibrary("heif"); + System.loadLibrary("jpeg62"); + System.loadLibrary("heif-convert"); + instance = new HeifJNI(); + } + return instance; + } + + private HeifJNI() {} public native int convertToDisk(byte[] data, String jpgOutputPath); } diff --git a/thirdparty/libheif/Release/heif-convert.dll b/thirdparty/libheif/Release/lib/amd64/heif-convert.dll similarity index 100% rename from thirdparty/libheif/Release/heif-convert.dll rename to thirdparty/libheif/Release/lib/amd64/heif-convert.dll diff --git a/thirdparty/libheif/Release/heif.dll b/thirdparty/libheif/Release/lib/amd64/heif.dll similarity index 100% rename from thirdparty/libheif/Release/heif.dll rename to thirdparty/libheif/Release/lib/amd64/heif.dll diff --git a/thirdparty/libheif/Release/jpeg62.dll b/thirdparty/libheif/Release/lib/amd64/jpeg62.dll similarity index 100% rename from thirdparty/libheif/Release/jpeg62.dll rename to thirdparty/libheif/Release/lib/amd64/jpeg62.dll diff --git a/thirdparty/libheif/Release/libde265.dll b/thirdparty/libheif/Release/lib/amd64/libde265.dll similarity index 100% rename from thirdparty/libheif/Release/libde265.dll rename to thirdparty/libheif/Release/lib/amd64/libde265.dll diff --git a/thirdparty/libheif/Release/libx265.dll b/thirdparty/libheif/Release/lib/amd64/libx265.dll similarity index 100% rename from thirdparty/libheif/Release/libx265.dll rename to thirdparty/libheif/Release/lib/amd64/libx265.dll diff --git a/thirdparty/libheif/Release/lib/x86_64/heif-convert.dll b/thirdparty/libheif/Release/lib/x86_64/heif-convert.dll new file mode 100644 index 0000000000..b056ba12df Binary files /dev/null and b/thirdparty/libheif/Release/lib/x86_64/heif-convert.dll differ diff --git a/thirdparty/libheif/Release/lib/x86_64/heif.dll b/thirdparty/libheif/Release/lib/x86_64/heif.dll new file mode 100644 index 0000000000..243e8aa4bd Binary files /dev/null and b/thirdparty/libheif/Release/lib/x86_64/heif.dll differ diff --git a/thirdparty/libheif/Release/lib/x86_64/jpeg62.dll b/thirdparty/libheif/Release/lib/x86_64/jpeg62.dll new file mode 100644 index 0000000000..1bbfea75c2 Binary files /dev/null and b/thirdparty/libheif/Release/lib/x86_64/jpeg62.dll differ diff --git a/thirdparty/libheif/Release/lib/x86_64/libde265.dll b/thirdparty/libheif/Release/lib/x86_64/libde265.dll new file mode 100644 index 0000000000..cd3abef372 Binary files /dev/null and b/thirdparty/libheif/Release/lib/x86_64/libde265.dll differ diff --git a/thirdparty/libheif/Release/lib/x86_64/libx265.dll b/thirdparty/libheif/Release/lib/x86_64/libx265.dll new file mode 100644 index 0000000000..f50a2ea2c2 Binary files /dev/null and b/thirdparty/libheif/Release/lib/x86_64/libx265.dll differ