view src/name/blackcap/exifwasher/exiv2/Image.kt @ 25:5a5a7de27eb4

ExifWasher -> JpegWasher
author David Barts <n5jrn@me.com>
date Thu, 16 Apr 2020 19:41:29 -0700
parents db63d01a23c6
children
line wrap: on
line source

/*
 * 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()
}