diff src/name/blackcap/exifwasher/exiv2/Image.kt @ 0:db63d01a23c6

JNI calls and test case (finally!) seem to work.
author David Barts <n5jrn@me.com>
date Tue, 31 Mar 2020 13:24:48 -0700
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/name/blackcap/exifwasher/exiv2/Image.kt	Tue Mar 31 13:24:48 2020 -0700
@@ -0,0 +1,29 @@
+/*
+ * Represents an image file we're examining and manipulating the metadata of.
+ */
+package name.blackcap.exifwasher.exiv2
+
+public class Image(path: String) {
+    init {
+        Initialize.libraries()
+    }
+
+    private external fun _ctor(path: String): Long
+    private external fun _writeMetadata()
+    private external fun _getMetadata(): Long
+    private external fun _dtor()
+
+    private val pointer: Long
+    init {
+        pointer = _ctor(path)
+    }
+
+    val metadata: ExifData
+    get() {
+        return ExifData(_getMetadata())
+    }
+
+    fun store() = _writeMetadata()
+
+    protected fun finalize() = _dtor()
+}