Giter Club home page Giter Club logo

native_exif's Introduction

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 latLong = await exif.getLatLong();
final attribute = await exif.getAttribute("key");
final attributes = await exif.getAttributes();

Writing attributes

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"});

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.

All raw attribute values must be of type String.

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.

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.

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.

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.

native_exif's People

Contributors

p-kuen avatar d-kuen avatar eduribas avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.