Arkaan Sayed
Arkaan Sayed

Reputation: 51

The exif data is not giving me the lat and long of an image in Flutter

I am trying to get the location of an image in flutter. I tried getting the lat and long from the image using the native_exif package.However it returns null for getLatLong() for an image, even when the image has a location tag.

final exif = await Exif.fromPath(file.path);
        final latLong = await exif.getLatLong();
        await exif.close();

When I print the exif I get the following keys as 0, GPS GPSLatitude: [0/0, 0/0, 0/0], GPS GPSAltitude: 0/0, GPS GPSLatitudeRef: , GPS GPSSpeed: 0/0, GPS GPSAltitudeRef: 0, GPS GPSProcessingMethod: , GPS GPSSpeedRef: , GPS GPSVersionID: [0, 0, 0, 0], GPS GPSLongitudeRef: , GPS GPSTimeStamp: [0/0, 0/0, 0/0], GPS GPSLongitude: [0/0, 0/0, 0/0]

Upvotes: 3

Views: 500

Answers (1)

Randa Omar Fahmy
Randa Omar Fahmy

Reputation: 321

Please refer to this answer I had the same problem and it helped me, so basically the missing thing here is the <uses-permission android:name="android.permission.ACCESS_MEDIA_LOCATION" /> inside the AndroidManifext.xml and make sure you request the permission in your flutter code

Upvotes: 1

Related Questions