native_exif
이미지의 EXIF 데이터를 읽고 쓰는 플러그인입니다.
Flutter용 간단한 EXIF 메타데이터 리더/라이터입니다.
{"sdk":"flutter"}>=0.19.0 <0.21.0아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
A simple EXIF metadata reader/writer for Flutter using native functions from iOS and Android.
First create a EXIF reader instance by reading out an image path:
final exif = await Exif.fromPath(pickedFile!.path);
Now you can run either pre-defined functions or get all attributes:
final originalDate = await exif.getOriginalDate();
final latLong = await exif.getLatLong();
final attribute = await exif.getAttribute("key");
final attributes = await exif.getAttributes();
It is possible to write raw EXIF data of type String to specific EXIF keys.
The keys are limited to the EXIF keys provided by the platform. See "Platform notes" for more details.
await exif.writeAttribute("key", "value");
await exif.writeAttributes({"key1": "value1", "key2": "value2"});
await exif.close();
This plugin does only work on iOS and Android. Other platforms are not yet supported.
This plugin uses the androidx ExifInterface.
[!IMPORTANT] Only specific EXIF and GPS attributes are supported. Please look for
val tags = ...at android/src/main/kotlin/com/cloudacy/native_exif/NativeExifPlugin.kt for a list of supported attributes.
All raw attribute values must be of type String.
[!IMPORTANT] Currently this plugin can only write ASCII characters correctly due to ExifInterface limitations.
Values for GPSLatitude and GPSLongitude can be written as negative values but will be returned as positive values. Use GPSLatitudeRef and GPSLongitudeRef or getLatLong() to determine the correct coordinates.
[!IMPORTANT] 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.
Values for GPSLatitude and GPSLongitude should be of type String and can be written as negative values but will be returned as positive values. Use GPSLatitudeRef and GPSLongitudeRef or getLatLong() to determine the correct coordinates.
For code docs, you can use the automatically generated reference on pub.dev.
For a better usage example, see the example folder or use the example page on pub.dev.