ionic-team / ionic-framework

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
https://ionicframework.com
MIT License
51.15k stars 13.5k forks source link

bug: invalid longitude and latitude when loading photo from gallery #23199

Closed uweDuesing closed 3 years ago

uweDuesing commented 3 years ago

Bug Report

Ionic version: [ ] 4.x [x] **5.5.2

Current behavior: My app can either take photos or load photos from the gallery. When taking the photos I can find valid longitude and latitude in the exif data. exif: .... GPSLatitude: "36/1,50/1,38958360/1000000" GPSLatitudeRef: "N" GPSLongitude: "174/1,45/1,43773480/1000000" GPSLongitudeRef: "W" ...

Loading the same photo from the gallery afterwards the longitude and latitude are shown as

exif: GPSLatitude: "0/1,0/1,0/1" GPSLatitudeRef: "" GPSLongitude: "0/1,0/1,0/1" GPSLongitudeRef: "" ...

Investigating the photo with an Exif reader I can see that the exif data is available, but Ionic replaces lon lat with strange values Expected behavior: I expect the same lat / lon to be shown no matter whether I take a photo or load the photo from the gallery

Steps to reproduce:

Related code:


  this.geolocation.getCurrentPosition({enableHighAccuracy: true}).then((pos: Geoposition) => {
        Camera.getPhoto({
          resultType: CameraResultType.Uri,
          source: CameraSource.Prompt,
          quality: 100
        }).then((capturedPhoto) => {
          if (this.platform.is('hybrid')) {
            console.log('!hybrid');
            console.log('capturedPhoto', capturedPhoto);

Other information:

Ionic info:

Ionic:

   Ionic CLI                     : 6.13.1 (C:\Users\duesingu\AppData\Roaming\npm\node_modules\@ionic\cli)
   Ionic Framework               : @ionic/angular 5.6.3
   @angular-devkit/build-angular : 0.1102.6
   @angular-devkit/schematics    : 11.2.6
   @angular/cli                  : 11.2.6
   @ionic/angular-toolkit        : 3.1.1

Capacitor:

   Capacitor CLI   : 2.4.7
   @capacitor/core : 2.4.7

Utility:

   cordova-res                          : not installed
   native-run (update available: 1.3.0) : 1.0.0

System:

   NodeJS : v12.18.0 (C:\Program Files\nodejs\node.exe)
   npm    : 6.14.4
   OS     : Windows 10
ionitron-bot[bot] commented 3 years ago

Thanks for the issue! This issue appears to be a support request. We use this issue tracker exclusively for bug reports and feature requests. Please use our forum or our slack channel for questions about the framework.

Thank you for using Ionic!