/flutter_exif

A Flutter plugin for accessing to all metadata from your photos. Supports iOS and Android.

Primary LanguageDartOtherNOASSERTION

flutter_exif

pub package

A Flutter plugin for accessing to all metadata from your photos. Supports iOS and Android.

Getting Started

In Android, you need to add the READ_EXTERNAL_STORAGE permission in your AndroidManifest.xml.

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

In iOS, you need to add the key NSPhotoLibraryUsageDescription in your Info.plist file.

<key>NSPhotoLibraryUsageDescription</key>
<string>We need access to your photos in your gallery for this demo</string>

Usage

Import package

To use this plugin you must add flutter_exif as a dependency in your pubspec.yaml file.

dependencies:
    flutter_exif: ^1.0.0

Example

import 'package:flutter_exif/flutter_exif.dart';

Listing images from your gallery filtered by an initial date and an end date. NOTE: By now, only the images with GPS data in their metadata is returned.

int startingAt = 1574679600;
int endingAt = 1575370800;
List<FlutterExifData> list = await FlutterExif.list( startingAt, endingAt );

Retrieve the image data for a FlutterExifData object:

FlutterExifData item = ...;
Uint8List data = await FlutterExif.image( item.identifier );

Models

FlutterExifData

class FlutterExifData {
    String identifier;
    int width;
    int height;
    int createdAt;
    double latitude;
    double longitude;
    double altitude;                        // Only in iOS
}

Credits

This plugin has been created and developed by Daniel MartĂ­nez.

Any suggestions and contributions are welcomed. Thanks for using this plugin!