integrate jni; need to keep from crashing

This commit is contained in:
Greg DiCristofaro 2022-02-28 16:00:52 -05:00
parent c243718ed4
commit 021df9eceb
13 changed files with 19 additions and 11 deletions

View File

@ -51,6 +51,7 @@ import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
import org.sleuthkit.autopsy.coreutils.ModuleSettings; import org.sleuthkit.autopsy.coreutils.ModuleSettings;
import org.sleuthkit.autopsy.coreutils.PlatformUtil; import org.sleuthkit.autopsy.coreutils.PlatformUtil;
import org.sleuthkit.autopsy.modules.filetypeid.FileTypeDetector; 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.python.JythonModuleLoader;
import org.sleuthkit.autopsy.texttranslation.TextTranslationService; import org.sleuthkit.autopsy.texttranslation.TextTranslationService;

View File

@ -80,8 +80,8 @@ public class HEICProcessor implements PictureProcessor {
public HEICProcessor() { public HEICProcessor() {
HeifJNI heifJNI; HeifJNI heifJNI;
try { try {
heifJNI = new HeifJNI(); heifJNI = HeifJNI.getInstance();
} catch (Exception ex) { } catch (UnsatisfiedLinkError ex) {
logger.log(Level.SEVERE, "libheif native dependencies not found. HEIC functionality will be automatically disabled.", ex); logger.log(Level.SEVERE, "libheif native dependencies not found. HEIC functionality will be automatically disabled.", ex);
heifJNI = null; heifJNI = null;
} }

View File

@ -20,18 +20,25 @@ package org.sleuthkit.autopsy.modules.pictureanalyzer.impls;
/** /**
* *
* Interop with libheif dll's. * Interop with libheif native dependencies.
*/ */
public class HeifJNI { public class HeifJNI {
// static { private static HeifJNI instance = null;
// 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"); public static HeifJNI getInstance() throws UnsatisfiedLinkError {
// System.load("C:\\Users\\gregd\\Documents\\Source\\heif_convert_test\\HeifConvertTestJNI\\dist\\Release\\heif.dll"); if (instance == null) {
// System.load("C:\\Users\\gregd\\Documents\\Source\\heif_convert_test\\HeifConvertTestJNI\\dist\\Release\\jpeg62.dll"); System.loadLibrary("libx265");
// System.load("C:\\Users\\gregd\\Documents\\Source\\heif_convert_test\\HeifConvertTestJNI\\dist\\Release\\heif-convert.dll"); 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); public native int convertToDisk(byte[] data, String jpgOutputPath);
} }

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.