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.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;

View File

@ -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;
}

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 {
// 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);
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.