How to extract image metadata Dart/Flutter

Viewed 1842

I am new to dart/flutter and I am trying to extract metadata from images. I am using flutter_image_gallery plugin to get all images on the device and it works fine but on the plugin page, it says it can get metadata and Thumbnail but I can't figure it out how to extract that.

1 Answers

exif plugin can be used to read the metadata of images. To use, read the image file using File.readAsBytesSync() then use readExifFromBytes().

final fileBytes = File(imagePath).readAsBytesSync();
final data = await readExifFromBytes(fileBytes);
Related