A.Ktns
A.Ktns

Reputation: 653

Is there a way to get the metadata of a picture in Flutter?

I am building an app where the users can upload the pictures from there phones. I would like to extract from the user's picture the metadata that shows the location that the picture was taken. How can I get it?

Upvotes: 3

Views: 7255

Answers (1)

Mehdi
Mehdi

Reputation: 170

you can use exif package

final ByteData bytes = await rootBundle.load('assets/jpg/2.jpg');
var list = bytes.buffer.asUint8List();

final data = await readExifFromBytes(list);

if (data.isEmpty) {
  print("No EXIF information found");
  return;
}

if (data.containsKey('JPEGThumbnail')) {
  print('File has JPEG thumbnail');
  data.remove('JPEGThumbnail');
}

enter image description here

Upvotes: 3

Related Questions