diff --git a/jni/NativeFormats/JavaNativeFormatPlugin.cpp b/jni/NativeFormats/JavaNativeFormatPlugin.cpp index 24643f947..a53f39da8 100644 --- a/jni/NativeFormats/JavaNativeFormatPlugin.cpp +++ b/jni/NativeFormats/JavaNativeFormatPlugin.cpp @@ -287,6 +287,6 @@ JNIEXPORT jboolean JNICALL Java_org_geometerplus_fbreader_formats_NativeFormatPl } extern "C" -JNIEXPORT jobject JNICALL Java_org_geometerplus_fbreader_formats_NativeFormatPlugin_readCoverInternal(JNIEnv* env, jobject thiz, jobject file) { - return 0; +JNIEXPORT void JNICALL Java_org_geometerplus_fbreader_formats_NativeFormatPlugin_readCoverInternal(JNIEnv* env, jobject thiz, jobject file, jobjectArray box) { + // TODO: implement } diff --git a/src/org/geometerplus/fbreader/formats/NativeFormatPlugin.java b/src/org/geometerplus/fbreader/formats/NativeFormatPlugin.java index 12ed02b5e..0f3a106ae 100644 --- a/src/org/geometerplus/fbreader/formats/NativeFormatPlugin.java +++ b/src/org/geometerplus/fbreader/formats/NativeFormatPlugin.java @@ -29,8 +29,6 @@ import org.geometerplus.fbreader.bookmodel.BookReadingException; import org.geometerplus.fbreader.library.Book; public class NativeFormatPlugin extends FormatPlugin { - private static Object ourCoversLock = new Object(); - // No free method because all plugins' instances are freed by // PluginCollection::deleteInstance method (C++) @@ -74,15 +72,14 @@ public class NativeFormatPlugin extends FormatPlugin { @Override public ZLSingleImage getRealImage() { - // Synchronized block is needed because we use temporary storage files - synchronized (ourCoversLock) { - return (ZLSingleImage)readCoverInternal(file); - } + final ZLImage[] box = new ZLImage[1]; + readCoverInternal(file, box); + return (ZLSingleImage)box[0]; } }; } - protected native ZLImage readCoverInternal(ZLFile file); + protected native void readCoverInternal(ZLFile file, ZLImage[] box); /* public static ZLImage createImage(String mimeType, String fileName, int offset, int length) {