native_exif 0.2.0
native_exif: ^0.2.0 copied to clipboard
A plugin to read and write exif data of images.
native_exif #
A simple EXIF metadata reader/writer for Flutter using native functions from iOS and Android.
Usage #
First create a EXIF reader instance by reading out an image path:
final exif = await Exif.fromPath(pickedFile!.path);
Reading attributes #
Now you can run either pre-defined functions or get all attributes:
final originalDate = await exif.getOriginalDate();
final attributes = await exif.getAttributes();
Writing attributes #
await exif.writeAttribute("key", "value");
await exif.writeAttributes({"key1": "value1", "key2": "value2"});
Close the exif interface #
await exif.close();
Platform notes #
This plugin does only work on iOS and Android. Other platforms are not yet supported.
Android #
Only specific EXIF and GPS attributes are supported. Please look at android/src/main/kotlin/com/cloudacy/native_exif/NativeExifPlugin.kt for a list of supported attributes.
iOS #
Only specific EXIF and GPS attributes are supported. Please look at EXIF dictionary keys and GPS dictionary keys for supported attributes.
Please note that all GPS dictionary keys need to be prefixed with GPS
.
For example: kCGImagePropertyGPSLatitude
== "Latitude"
, which equals to "GPSLatitude"
in native_exif
.
API Docs #
For code docs, you can use the automatically generated reference on pub.dev.
Example #
For a better usage example, see the example folder or use the example page on pub.dev.