bigflood / dartexif

Dart package to decode Exif data from tiff, jpeg and heic files
https://pub.dev/packages/exif
MIT License
30 stars 29 forks source link

How can I convert lat log data to real world data? #30

Closed kotran88 closed 2 years ago

kotran88 commented 2 years ago

I checked with my image which have lat lng information

code is as exampled.


final data = await readExifFromBytes(fileBytes);

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

  for (final entry in data.entries) {
    print("${entry.key}: ${entry.value}");
  }

but result is

I/flutter (29756): GPS GPSDate: 2021:12:18 I/flutter (29756): GPS GPSProcessingMethod: [65, 83, 67, 73, 73, 0, 0, 0, 71, 80, 83, 0] I/flutter (29756): GPS GPSTimeStamp: [14, 48, 34] I/flutter (29756): GPS GPSAltitude: 13483/125 I/flutter (29756): GPS GPSAltitudeRef: 0 I/flutter (29756): GPS GPSLongitude: [127, 5, 150143/10000] I/flutter (29756): GPS GPSLongitudeRef: E I/flutter (29756): GPS GPSLatitude: [35, 48, 40797/1250] I/flutter (29756): GPS GPSLatitudeRef: N I/flutter (29756): Image ExifOffset: 212

how can I convert GPS latitude like 35, 48, 40797/1250 to gps data to search in google map?

bigflood commented 2 years ago

@kotran88 There is example code in the link bellow.
https://github.com/bigflood/dartexif/blob/master/example/gps_coords.dart#L40

kotran88 commented 2 years ago

ok Thank you! I just tried again but happened to meet new error.

: Error: The getter 'entries' isn't defined for the class 'Future<Map<String, IfdTag>>'. lib/pages/home_screen.dart:302

full code is..


 final fileBytes = File('/storage/emulated/0/DCIM/Camera/20211218_234840.jpg').readAsBytesSync();
  final data =  readExifFromBytes(fileBytes);
  print("gogo");
print(data);
  if (data.isEmpty) {
    print("No EXIF information found");
    return;
  }

  for (final entry in data.entries) {
    print("${entry.key}: ${entry.value}");
  }
bigflood commented 2 years ago

@kotran88 you left out await. https://github.com/bigflood/dartexif/blob/master/example/example.dart#L10

kotran88 commented 2 years ago

thank you !!!