'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?



Solution 1:[1]

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mehdi