Menu

#900 Location not saved in Tags for Pixel 6 Pro / Android 12

1.0
closed
nobody
None
2022-10-06
2021-11-19
Enteq
No

The location is not saved on Pixel 6 Pro with Android 12.
I am using camera2
Location does work with the official Google Camera.
I had OsmAND running at the same time on the same phone and recording a gpx track, which did record correctly, so the GPS is working.
I deleted and re-installed the App, no relevant changes. Also, when I enable the option to require a GPS fix to shoot a photo, I can shoot photos nonetheless, but the GPS location does still not get saved.

The following is a list of all EXIF Tags:

$ exiftool IMG_20211119_150502.jpg
ExifTool Version Number : 12.16
File Name : IMG_20211119_150502.jpg
Directory : .
File Size : 4.0 MiB
File Modification Date/Time : 2021:11:19 15:05:02+01:00
File Access Date/Time : 2021:11:19 19:56:11+01:00
File Inode Change Date/Time : 2021:11:19 19:56:06+01:00
File Permissions : rw-rw-r--
File Type : JPEG
File Type Extension : jpg
MIME Type : image/jpeg
Exif Byte Order : Little-endian (Intel, II)
Camera Model Name : Pixel 6 Pro
Make : Google
Exif Version : 0220
User Comment : Yaw:353.62924,Pitch:-12.234969284934222,Roll:7.551471247746576
Exif Image Width : 4032
ISO : 59
Offset Time Digitized : +01:00
Exif Image Height : 3024
Sub Sec Time Digitized : 384689
Date/Time Original : 2021:11:19 15:05:02
Warning : [minor] Unrecognized MakerNotes
Sub Sec Time Original : 384689
White Balance : Manual
Create Date : 2021:11:19 15:05:02
Focal Length : 6.8 mm
Exposure Time : 1/215
Offset Time : +01:00
Offset Time Original : +01:00
Flash : No Flash
Sub Sec Time : 384689
F Number : 1.9
Light Source : Unknown
Orientation : Horizontal (normal)
Modify Date : 2021:11:19 15:05:02
GPS Latitude Ref : North
GPS Time Stamp : 14:05:02
GPS Date Stamp : 2021:11:19
GPS Img Direction : 353.63
GPS Img Direction Ref : Magnetic North
JFIF Version : 1.01
Resolution Unit : None
X Resolution : 1
Y Resolution : 1
Profile CMM Type :
Profile Version : 4.0.0
Profile Class : Display Device Profile
Color Space Data : RGB
Profile Connection Space : XYZ
Profile Date Time : 2016:12:08 09:38:28
Profile File Signature : acsp
Primary Platform : Unknown ()
CMM Flags : Not Embedded, Independent
Device Manufacturer : Google
Device Model :
Device Attributes : Reflective, Glossy, Positive, Color
Rendering Intent : Perceptual
Connection Space Illuminant : 0.9642 1 0.82491
Profile Creator : Google
Profile ID : 75e1a6b13c34376310c8ab660632a28a
Profile Description : sRGB IEC61966-2.1
Profile Copyright : Copyright (c) 2016 Google Inc.
Media White Point : 0.95045 1 1.08905
Media Black Point : 0 0 0
Red Matrix Column : 0.43604 0.22249 0.01392
Green Matrix Column : 0.38512 0.7169 0.09706
Blue Matrix Column : 0.14305 0.06061 0.71391
Red Tone Reproduction Curve : (Binary data 32 bytes, use -b option to extract)
Chromatic Adaptation : 1.04788 0.02292 -0.05019 0.02959 0.99048 -0.01704 -0.00922 0.01508 0.75168
Blue Tone Reproduction Curve : (Binary data 32 bytes, use -b option to extract)
Green Tone Reproduction Curve : (Binary data 32 bytes, use -b option to extract)
Image Width : 4032
Image Height : 3024
Encoding Process : Baseline DCT, Huffman coding
Bits Per Sample : 8
Color Components : 3
Y Cb Cr Sub Sampling : YCbCr4:2:0 (2 2)
Aperture : 1.9
Image Size : 4032x3024
Megapixels : 12.2
Shutter Speed : 1/215
Create Date : 2021:11:19 15:05:02.384689+01:00
Date/Time Original : 2021:11:19 15:05:02.384689+01:00
Modify Date : 2021:11:19 15:05:02.384689+01:00
GPS Date/Time : 2021:11:19 14:05:02Z
Focal Length : 6.8 mm
Light Value : 10.3

Discussion

  • Anonymous

    Anonymous - 2021-12-01

    I verified this in the source, the source is correct, in CameraController2.java:424
    builder.set(CaptureRequest.JPEG_GPS_LOCATION, location);

    It seems to me that the camera2 API has a bug.
    Also FreeDCam will not set the location correctly. But gcam will.

     
  • Enteq

    Enteq - 2022-01-06
     
  • Anonymous

    Anonymous - 2022-07-08

    Same problem with my Pixel 6 and Open Camera v 1.50.1
    If I use original Camera API, the gps location is saved
    If I use Camera2 API, the gps location is not saved

     
  • Anonymous

    Anonymous - 2022-07-08

    Yes same problem has appeared here lack of Latitude & Longitude , have just changed phone to a Pixel 6 Pro and whilst the Stamped information appears correctly its not stored in the metadata at all under API2 and incorrect values under API1.!

     
  • Shawn Hughes

    Shawn Hughes - 2022-09-09

    Pixel 6: Now on Android 13. OpenCamera v1.50.1: Still a problem: every image since Nov 25 2021 is missing GPS data. Google Camera images contain GPS data.
    Workaround, Enteq, (2022Jan): Now September. Still Open. ?! Is this a fix? Have we uncovered the root cause? A better fix?
    Very frustrating as 90% of my images are from Open Camera.

     
    • Shawn Hughes

      Shawn Hughes - 2022-09-10

      Tried API1: I'm generally at 42N 83W. This is what is stored:
      GPS Date/Time : 2022:09:10 12:42:55Z
      GPS Latitude : 1 deg 3' 43.45" N
      GPS Longitude : 944 deg 38' 46.75" W
      GPS Position : 1 deg 3' 43.45" N, 944 deg 38' 46.75" W

       

      Last edit: Shawn Hughes 2022-09-10
    • Enteq

      Enteq - 2022-09-13

      In this commit a fix has been attempted by @mark-h : https://sourceforge.net/p/opencamera/code/ci/979ef37fa495058546d4ccadd60317d903a23eb8/
      This fix is quite similar to what I did, it also propagates the location into all the necessary places in the code. However, this fix only works, if I enable the X-Night extension. Obviously, as the code says, that fix only triggers if "using extensions" whatever that means. I guess that for some reason, for the Pixel 6 Pro, somewhere in the path the "extensions" are probably "used" internally all the time, so the fix does not cover all necessary paths.
      Repairing that in the official version seems to be quite easy, just modify the official fix a bit more:
      Just make sure that the exif.setGpsInfo(location); is not only called if "using_camera_extensions is True, but also if it is False, as long as "location is True.
      (The only other thing I did is I added the condition (!exif.hasAttribute(ExifInterface.TAG_GPS_LATITUDE) || !exif.hasAttribute(ExifInterface.TAG_GPS_LONGITUDE))
      Just to be sure that an existing GPS location isn't overwritten needlessly, but I am not sure if it is necessary.)

      Maybe I'll make a fix for the new version as well, if I find time...

       

      Last edit: Enteq 2022-09-13
      • Enteq

        Enteq - 2022-09-13

        This is the fix for the new version. I tested it, it works (the most annoying part of it was updating the android studio...)
        @mark-h : I don't know if the addDateTimeExif needs to be called as well. Up until now I didn't miss it in my images.

        diff --git a/app/src/main/java/net/sourceforge/opencamera/ImageSaver.java b/app/src/main/java/net/sourceforge/opencamera/ImageSaver.java
        index b5defeac..8d3fb1c6 100644
        --- a/app/src/main/java/net/sourceforge/opencamera/ImageSaver.java
        +++ b/app/src/main/java/net/sourceforge/opencamera/ImageSaver.java
        @@ -3605,12 +3605,12 @@ public class ImageSaver extends Thread {
                         Log.d(TAG, "UserComment: " + exif.getAttribute(ExifInterface.TAG_USER_COMMENT));
                 }
                 setCustomExif(exif, custom_tag_artist, custom_tag_copyright);
        +
        
        +        if (store_location && (!exif.hasAttribute(ExifInterface.TAG_GPS_LATITUDE) || !exif.hasAttribute(ExifInterface.TAG_GPS_LONGITUDE))) {
        +            exif.setGpsInfo(location);
        +        }
                 if( using_camera_extensions ) {
                     addDateTimeExif(exif, current_date);
        -            if( store_location ) {
        -                // also need to store geotagging, since Camera API doesn't support doing this for camera extensions
        -                exif.setGpsInfo(location);
        -            }
                 }
                 else if( needGPSTimestampHack(is_jpeg, using_camera2, store_location) ) {
                     fixGPSTimestamp(exif, current_date);
        
         
  • Mark

    Mark - 2022-10-06

    Thanks for the comments. For Camera2 API this will be fixed for the next version (it seems to be a Pixel bug that it's not putting the information there already, but as noted it's easy to workaround by adding it afterwards).

    For old camera API, I can reproduce the problem that the location is present but wrong. Again this seems to be a Pixel 6 Pro bug, but harder to resolve (I could just overwrite the exif info, but risk that affects all devices). In practice I plan to start making Camera2 the default on some devices such as Pixels anyway.

     
  • Mark

    Mark - 2022-10-06
    • status: open --> closed
     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB