Skip to content

image_picker doesn't provide GPS metadata for the image taken on IOS #45148

@marks5

Description

@marks5

Hi,

It seems like the image picker for ios does not provide GPS image metadata when taking an image.
On Android its working fine. But when using the same code and the same image on IOS, the image is displayed correctly but no GPS metadata is returned.

Code to reproduce:

import 'package:exif/exif.dart';
import 'package:image_picker/image_picker.dart';

...

var image = await ImagePicker.pickImage(source: ImageSource.camera);
var bytes = await image.readAsBytes();
var tags = await readExifFromBytes(bytes);
Map<String, String> mTags = HashMap();
try {
      mTags.addAll(exifToGPS(tags));
}catch(e){
   print("noexif");
}finally{
  tags.forEach((key, value) {
  print({"$key":"$value"});
  mTags.addAll({"$key":"$value"});
});

which on ios provide:

Logs

2019-11-19 02:11:56.169708-0300 Genecoin[3070:582730] flutter: {Image Make: Apple}
2019-11-19 02:11:56.170088-0300 Genecoin[3070:582730] flutter: {Image Model: iPhone 8}
2019-11-19 02:11:56.170146-0300 Genecoin[3070:582730] flutter: {Image Orientation: Rotated 90 CW}
2019-11-19 02:11:56.170195-0300 Genecoin[3070:582730] flutter: {Image XResolution: 72}
2019-11-19 02:11:56.170233-0300 Genecoin[3070:582730] flutter: {Image YResolution: 72}
2019-11-19 02:11:56.170275-0300 Genecoin[3070:582730] flutter: {Image ResolutionUnit: Pixels/Inch}
2019-11-19 02:11:56.170313-0300 Genecoin[3070:582730] flutter: {Image Software: 13.2.2}
2019-11-19 02:11:56.170370-0300 Genecoin[3070:582730] flutter: {Image DateTime: 2019:11:19 02:11:54}
2019-11-19 02:11:56.170408-0300 Genecoin[3070:582730] flutter: {Image ExifOffset: 182}
2019-11-19 02:11:56.170444-0300 Genecoin[3070:582730] flutter: {EXIF ExposureTime: 1/4}
2019-11-19 02:11:56.170485-0300 Genecoin[3070:582730] flutter: {EXIF FNumber: 9/5}
2019-11-19 02:11:56.170633-0300 Genecoin[3070:582730] flutter: {EXIF ExposureProgram: Program Normal}
2019-11-19 02:11:56.170787-0300 Genecoin[3070:582730] flutter: {EXIF ISOSpeedRatings: 100}
2019-11-19 02:11:56.170961-0300 Genecoin[3070:582730] flutter: {EXIF DateTimeOriginal: 2019:11:19 02:11:54}
2019-11-19 02:11:56.171063-0300 Genecoin[3070:582730] flutter: {EXIF DateTimeDigitized: 2019:11:19 02:11:54}
2019-11-19 02:11:56.171164-0300 Genecoin[3070:582730] flutter: {EXIF Tag 0x9010: -03:00}
2019-11-19 02:11:56.171307-0300 Genecoin[3070:582730] flutter: {EXIF Tag 0x9011: -03:00}
2019-11-19 02:11:56.171411-0300 Genecoin[3070:582730] flutter: {EXIF Tag 0x9012: -03:00}
2019-11-19 02:11:56.171519-0300 Genecoin[3070:582730] flutter: {EXIF ShutterSpeedValue: 53320/26659}
2019-11-19 02:11:56.171617-0300 Genecoin[3070:582730] flutter: {EXIF ApertureValue: 54823/32325}
2019-11-19 02:11:56.171723-0300 Genecoin[3070:582730] flutter: {EXIF BrightnessValue: -24551/20230}
2019-11-19 02:11:56.171878-0300 Genecoin[3070:582730] flutter: {EXIF ExposureBiasValue: 0}
2019-11-19 02:11:56.172003-0300 Genecoin[3070:582730] flutter: {EXIF MeteringMode: Pattern}
2019-11-19 02:11:56.172225-0300 Genecoin[3070:582730] flutter: {EXIF Flash: Flash did not fire, compulsory flash mode}
2019-11-19 02:11:56.172354-0300 Genecoin[3070:582730] flutter: {EXIF FocalLength: 399/100}
2019-11-19 02:11:56.172459-0300 Genecoin[3070:582730] flutter: {EXIF SubjectArea: [2015, 1511, 2217, 1330]}
2019-11-19 02:11:56.172575-0300 Genecoin[3070:582730] flutter: {EXIF MakerNote: [65, 112, 112, 108, 101, 32, 105, 79, 83, 0, 0, 1, 77, 77, 0, 23, 0, 1, 0, 9, ... ]}
2019-11-19 02:11:56.172735-0300 Genecoin[3070:582730] flutter: {EXIF SubSecTimeOriginal: 669}
2019-11-19 02:11:56.173047-0300 Genecoin[3070:582730] flutter: {EXIF SubSecTimeDigitized: 669}
2019-11-19 02:11:56.173188-0300 Genecoin[3070:582730] flutter: {EXIF ColorSpace: Uncalibrated}
2019-11-19 02:11:56.173327-0300 Genecoin[3070:582730] flutter: {EXIF ExifImageWidth: 4032}
2019-11-19 02:11:56.173474-0300 Genecoin[3070:582730] flutter: {EXIF ExifImageLength: 3024}
2019-11-19 02:11:56.173616-0300 Genecoin[3070:582730] flutter: {EXIF SensingMethod: One-chip color area}
2019-11-19 02:11:56.173786-0300 Genecoin[3070:582730] flutter: {EXIF SceneType: Directly Photographed}
2019-11-19 02:11:56.173921-0300 Genecoin[3070:582730] flutter: {EXIF ExposureMode: Auto Exposure}
2019-11-19 02:11:56.174686-0300 Genecoin[3070:582730] flutter: {EXIF WhiteBalance: Auto}
2019-11-19 02:11:56.174734-0300 Genecoin[3070:582730] flutter: {EXIF FocalLengthIn35mmFilm: 28}
2019-11-19 02:11:56.174780-0300 Genecoin[3070:582730] flutter: {EXIF LensSpecification: [4183519/1048501, 4183519/1048501, 9/5, 9/5]}
2019-11-19 02:11:56.174818-0300 Genecoin[3070:582730] flutter: {EXIF LensMake: Apple}
2019-11-19 02:11:56.174856-0300 Genecoin[3070:582730] flutter: {EXIF LensModel: iPhone 8 back camera 3.99mm f/1.8}
2019-11-19 02:11:56.174895-0300 Genecoin[3070:582730] flutter: {MakerNote Tag 0x0001: 11}
2019-11-19 02:11:56.174934-0300 Genecoin[3070:582730] flutter: {MakerNote Tag 0x0002: [89, 0, 81, 0, 52, 0, 62, 0, 43, 0, 19, 0, 36, 0, 39, 0, 108, 0, 219, 1, ... ]}
2019-11-19 02:11:56.174977-0300 Genecoin[3070:582730] flutter: {MakerNote Tag 0x0003: [6, 7, 8, 85, 102, 108, 97, 103, 115, 85, 118, 97, 108, 117, 101, 85, 101, 112, 111, 99, ... ]}
2019-11-19 02:11:56.175080-0300 Genecoin[3070:582730] flutter: {MakerNote Tag 0x0004: 1}
2019-11-19 02:11:56.175120-0300 Genecoin[3070:582730] flutter: {MakerNote Tag 0x0005: 131}
2019-11-19 02:11:56.175240-0300 Genecoin[3070:582730] flutter: {MakerNote Tag 0x0006: 125}
2019-11-19 02:11:56.175620-0300 Genecoin[3070:582730] flutter: {MakerNote Tag 0x0007: 1}
2019-11-19 02:11:56.175896-0300 Genecoin[3070:582730] flutter: {MakerNote Tag 0x0008: [-677380097/-1823670270, 18082/7717, 256/7455]}
2019-11-19 02:11:56.176010-0300 Genecoin[3070:582730] flutter: {MakerNote Tag 0x000C: [16791861/808728899, 188575604/178536713]}
2019-11-19 02:11:56.176148-0300 Genecoin[3070:582730] flutter: {MakerNote Tag 0x000D: 9}
2019-11-19 02:11:56.176257-0300 Genecoin[3070:582730] flutter: {MakerNote Tag 0x000E: 4}
2019-11-19 02:11:56.176408-0300 Genecoin[3070:582730] flutter: {MakerNote Tag 0x000F: 2}
2019-11-19 02:11:56.176522-0300 Genecoin[3070:582730] flutter: {MakerNote Tag 0x0010: 1}
2019-11-19 02:11:56.176727-0300 Genecoin[3070:582730] flutter: {MakerNote Tag 0x0014: 5}
2019-11-19 02:11:56.176845-0300 Genecoin[3070:582730] flutter: {MakerNote Tag 0x0017: 0}
2019-11-19 02:11:56.176978-0300 Genecoin[3070:582730] flutter: {MakerNote Tag 0x0019: 0}
2019-11-19 02:11:56.177117-0300 Genecoin[3070:582730] flutter: {MakerNote Tag 0x001F: 0}
2019-11-19 02:11:56.177224-0300 Genecoin[3070:582730] flutter: {MakerNote Tag 0x0020: 47C6-BF06-AA77C794924C}
2019-11-19 02:11:56.177428-0300 Genecoin[3070:582730] flutter: {MakerNote Tag 0x0021: 78657/825377590}
2019-11-19 02:11:56.177552-0300 Genecoin[3070:582730] flutter: {MakerNote Tag 0x0025: 0}
2019-11-19 02:11:56.177676-0300 Genecoin[3070:582730] flutter: {MakerNote Tag 0x0026: 0}
2019-11-19 02:11:56.177915-0300 Genecoin[3070:582730] flutter: {MakerNote Tag 0x0027: 232196366/178720009}
2019-11-19 02:11:56.178031-0300 Genecoin[3070:582730] flutter: {MakerNote Tag 0x002B: 47EA-92EF-066AE9C6D655}

doctor

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.9.1+hotfix.6, on Mac OS X 10.14.6 18G1012,
    locale en-BR)
[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor
      --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 11.2.1)
[✓] Android Studio (version 3.4)
[✓] Connected device (1 available)

Metadata

Metadata

Assignees

No one assigned

    Labels

    found in release: 1.27Found to occur in 1.27has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: image_pickerThe Image Picker plugin.packageflutter/packages repository. See also p: labels.platform-iosiOS applications specifically

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions