dartexif icon indicating copy to clipboard operation
dartexif copied to clipboard

dartexif reports 0/0, 0/0, 0/0 for lat/lon, but file is geotagged

Open abhlabs opened this issue 2 years ago • 8 comments

exif.tools web site reports the correct lat/lon, but all I see in the data from dartexif is this:

I/flutter (25377): GPS GPSVersionID: [0, 0, 0, 0] I/flutter (25377): GPS GPSLatitudeRef: I/flutter (25377): GPS GPSLatitude: [0/0, 0/0, 0/0] I/flutter (25377): GPS GPSLongitudeRef: I/flutter (25377): GPS GPSLongitude: [0/0, 0/0, 0/0] I/flutter (25377): Image GPSInfo: 1012 I thought maybe the file had GPS info stripped out, so i transferred it from the android emulator to my windows desktop, then uploaded to exif.tools web site, and it reports the correct lat/lon.

Is there something wrong in my process?

abhlabs avatar Jun 30 '23 01:06 abhlabs

i'm facing the same promblem in android api33 image

SG-XM avatar Aug 15 '23 11:08 SG-XM

i'm facing the same promblem in android api33

In my case, I discovered that images picked directly from the "downloads" folder had their GPS information stripped. The GPS info was in the file, and that's why I was able to see it when I transferred the file back to Windows and used other tools. Something about picking the file directly from "Downloads" causes the GPS to be stripped.

How I got around that problem was to initiate the selection using the "Photos" app, then navigate to "Downloads". Then when you inspect the exif tags, I started seeing valid GPS data. I don't think this is an issue with dartexif, and it may not be an issue with the Dart Image Picker package (which I'm using to do the photo file selection) -- I think it has something to do with Android security.

Hope this helps!

abhlabs avatar Aug 20 '23 23:08 abhlabs

i'm facing the same promblem in android api33 image

Facing same issue for Android 13 only. For android 12, it's working fine. Please let me know if you found any solution yet.

RafatMeraz avatar Sep 27 '23 09:09 RafatMeraz

i'm facing the same promblem in android api33

In my case, I discovered that images picked directly from the "downloads" folder had their GPS information stripped. The GPS info was in the file, and that's why I was able to see it when I transferred the file back to Windows and used other tools. Something about picking the file directly from "Downloads" causes the GPS to be stripped.

How I got around that problem was to initiate the selection using the "Photos" app, then navigate to "Downloads". Then when you inspect the exif tags, I started seeing valid GPS data. I don't think this is an issue with dartexif, and it may not be an issue with the Dart Image Picker package (which I'm using to do the photo file selection) -- I think it has something to do with Android security.

Hope this helps!

But in my scenario, I am picking my images from gallery via File picker.

RafatMeraz avatar Sep 27 '23 12:09 RafatMeraz

Have a look at this: android docs. You might need an extra permission for this to work.

Flajt avatar Sep 29 '23 13:09 Flajt

Have a look at this: android docs. You might need an extra permission for this to work.

Thank Flajt. i think you are right. For who need to access GPS information from Exif of media file on Android, you may need to ensure that:

  1. Add ACCESS_MEDIA_LOCATION permission to your AndroidManifest.xml file

  2. Before using the file picker like ImagePicker. you may have to request media location access permission. on my source, i use permission_handler: https://pub.dev/packages/permission_handler.

var status = await Permission.accessMediaLocation.status; if (!status.isGranted) { await Permission.accessMediaLocation.request(); }

Hope it help!

ankhanguit avatar Oct 09 '23 04:10 ankhanguit

i am also facing same issue. i am using image_picker: ^1.0.4.

   final fileBytes = File(widget.imageFile.path).readAsBytesSync();
   final data = await readExifFromBytes(fileBytes);

i am getting GPSLatitude and GPSLongitude 0/0,0/0,0/0

i have tried by doing

   if (!status.isGranted) {
   //not prompting the any permission request here
  await Permission.accessMediaLocation.request();
}

//getting photo from gallery final pickedImage = await ImagePicker().pickImage(source: ImageSource.photos);

where as by doing 

    final pickedImage = await ImagePicker().pickImage(source: ImageSource.photos);
    
    i am getting location info.

sachinbpatil619 avatar Nov 07 '23 10:11 sachinbpatil619

i am also facing same issue. i am using image_picker: ^1.0.4.

   final fileBytes = File(widget.imageFile.path).readAsBytesSync();
   final data = await readExifFromBytes(fileBytes);

i am getting GPSLatitude and GPSLongitude 0/0,0/0,0/0

i have tried by doing

   if (!status.isGranted) {
   //not prompting the any permission request here
  await Permission.accessMediaLocation.request();
}

//getting photo from gallery final pickedImage = await ImagePicker().pickImage(source: ImageSource.photos);

where as by doing 

    final pickedImage = await ImagePicker().pickImage(source: ImageSource.photos);
    
    i am getting location info.

Have you tried file_picker for picking photos?

svoza10 avatar Nov 07 '23 14:11 svoza10