Bug 511467 - Cannot see GPS metadata in HEIC photos
Summary: Cannot see GPS metadata in HEIC photos
Status: VERIFIED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Metadata-Engine (other bugs)
Version First Reported In: 8.7.0
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-11-01 14:18 UTC by jblum66
Modified: 2025-11-05 08:30 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 8.9.0
Sentry Crash Report:


Attachments
Test photo (914.20 KB, application/octet-stream)
2025-11-01 14:18 UTC, jblum66
Details
Original file from the smartphone (914.20 KB, application/octet-stream)
2025-11-01 17:38 UTC, jblum66
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jblum66 2025-11-01 14:18:20 UTC
Created attachment 186387 [details]
Test photo

SUMMARY

No GPS informations retrieved from HEIC photos in Digikam with or without using Exiftool.

STEPS TO REPRODUCE
1. Click the test photo in Digikam 8.7.0
2. In the Metadata tab, there is no information in IPTC and XMP panels. No GPS information in EXIF.
3. Exiftool can perfectly read the GPS information dfrom a Windows command line.

OBSERVED RESULT

In the Metadata tab, there is no information in IPTC and XMP panels. No GPS information in EXIF.
Exiftool 13.40 can perfectly read the GPS information of this image from a Windows command line.

EXPECTED RESULT

Digikam should detect the GPS informations using exiftool 13.40.

SOFTWARE/OS VERSIONS
Windows 11 25H2

ADDITIONAL INFORMATION
Exiftool 13.40 installed and used by Digikam.

h:\Program Files\exiftool>exiftool.exe x:\xxx\Pictures\IMG_20251011_222520.HEIC
ExifTool Version Number         : 13.40
File Name                       : IMG_20251011_222520.HEIC
Directory                       : x:/xxx/Pictures
Warning                         : FileName encoding must be specified [x2]
File Size                       : 936 kB
File Modification Date/Time     : 2025:10:11 22:25:20+02:00
File Access Date/Time           : 2025:11:01 15:08:48+01:00
File Creation Date/Time         : 2025:11:01 10:35:31+01:00
File Permissions                : -rw-rw-rw-
File Type                       : HEIC
File Type Extension             : heic
MIME Type                       : image/heic
Major Brand                     : High Efficiency Image Format HEVC still image (.HEIC)
Minor Version                   : 0.0.0
Compatible Brands               : mif1, heic, miaf
Handler Type                    : Picture
Primary Item Reference          : 49
Meta Image Size                 : 4096x3072
Exif Byte Order                 : Little-endian (Intel, II)
Orientation                     : Horizontal (normal)
GPS Latitude Ref                : North
GPS Speed                       : 0
GPS Altitude Ref                : Above Sea Level
GPS Processing Method           : network
GPS Speed Ref                   : km/h
GPS Longitude Ref               : East
GPS Time Stamp                  : 20:25:09
GPS Date Stamp                  : 2025:10:11
Y Resolution                    : 72
X Resolution                    : 72
Y Cb Cr Positioning             : Centered
Exif Version                    : 0220
Aperture Value                  : 2.0
Scene Type                      : Directly photographed
Subject Distance Range          : Distant
Mirror                          : false
Sensor Type                     : rear
Hdr                             : auto
Op Mode                         : 36866
Small Picture                   : false
AI Scene                        : 7
Filter Id                       : 66048
Zoom Multiple                   : 5
Exposure Compensation           : 0
Exposure Program                : Program AE
Subject Distance                : 5.165 m
Color Space                     : Uncalibrated
Max Aperture Value              : 2.0
Exif Image Height               : 3072
Brightness Value                : -4.9
Date/Time Original              : 2025:10:11 22:25:20
Flashpix Version                : 0100
Sub Sec Time Original           : 344
White Balance                   : Auto
Interoperability Index          : R98 - DCF basic file (sRGB)
Interoperability Version        : 0100
Exposure Mode                   : Auto
Exposure Time                   : 1/13
Offset Time                     : +02:00
Flash                           : Off, Did not fire
Sub Sec Time                    : 344
F Number                        : 2.0
Exif Image Width                : 4096
ISO                             : 5000
Components Configuration        : Y, Cb, Cr, -
Offset Time Digitized           : +02:00
Focal Length In 35mm Format     : 120 mm
Sub Sec Time Digitized          : 344
Digital Zoom Ratio              : 14.6341
Create Date                     : 2025:10:11 22:25:20
Shutter Speed Value             : 1/12
Metering Mode                   : Center-weighted average
Focal Length                    : 9.0 mm
Offset Time Original            : +02:00
Scene Capture Type              : Standard
Light Source                    : D65
Sensing Method                  : Not defined
Resolution Unit                 : inches
Xiaomi Model                    : POCO F7 Ultra
Compression                     : JPEG (old-style)
Thumbnail Offset                : 766275
Thumbnail Length                : 9560
Camera Model Name               : POCO F7 Ultra
Make                            : Xiaomi
Modify Date                     : 2025:10:11 22:25:20
HEVC Configuration Version      : 1
General Profile Space           : Conforming
General Tier Flag               : Main Tier
General Profile IDC             : Main Still Picture
Gen Profile Compatibility Flags : Main Still Picture
Constraint Indicator Flags      : 96 0 0 0 0 0
General Level IDC               : 150 (level 5.0)
Min Spatial Segmentation IDC    : 0
Parallelism Type                : 0
Chroma Format                   : 4:2:0
Bit Depth Luma                  : 8
Bit Depth Chroma                : 8
Average Frame Rate              : 0
Constant Frame Rate             : Unknown
Num Temporal Layers             : 0
Temporal ID Nested              : No
Profile CMM Type                :
Profile Version                 : 4.0.0
Profile Class                   : Display Device Profile
Color Space Data                : RGB
Profile Connection Space        : XYZ
Profile Date Time               : 2022:08:08 08:08:08
Profile File Signature          : acsp
Primary Platform                : Unknown ()
CMM Flags                       : Not Embedded, Independent
Device Manufacturer             : Unknown (XM  )
Device Model                    :
Device Attributes               : Reflective, Glossy, Positive, Color
Rendering Intent                : Perceptual
Connection Space Illuminant     : 0.9642 1 0.82491
Profile Creator                 : Apple Computer Inc.
Profile ID                      : 0
Profile Description             : sRGB EOTF with DCI-P3 Color Gamut
Profile Copyright               : Copyright Xiaomi Communications Co., Ltd. 2022
Media White Point               : 0.96419 1 0.82489
Red Matrix Column               : 0.51512 0.2412 -0.00105
Green Matrix Column             : 0.29198 0.69225 0.04189
Blue Matrix Column              : 0.1571 0.06657 0.78407
Red Tone Reproduction Curve     : (Binary data 32 bytes, use -b option to extract)
Chromatic Adaptation            : 1.04788 0.02292 -0.0502 0.02959 0.99048 -0.01706 -0.00923 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                     : 4096
Image Height                    : 3072
Image Spatial Extent            : 4096x3072
Media Data Size                 : 932693
Media Data Offset               : 3446
Aperture                        : 2.0
Image Size                      : 4096x3072
Megapixels                      : 12.6
Scale Factor To 35 mm Equivalent: 13.3
Shutter Speed                   : 1/13
Create Date                     : 2025:10:11 22:25:20.344+02:00
Date/Time Original              : 2025:10:11 22:25:20.344+02:00
Modify Date                     : 2025:10:11 22:25:20.344+02:00
Thumbnail Image                 : (Binary data 9560 bytes, use -b option to extract)
GPS Altitude                    : 221.2 m Above Sea Level
GPS Date/Time                   : 2025:10:11 20:25:09Z
GPS Latitude                    : 48 deg 47' 19.11" N
GPS Longitude                   : 2 deg 2' 20.46" E
Circle Of Confusion             : 0.002 mm
Depth Of Field                  : 3.23 m (4.01 - 7.24 m)
Field Of View                   : 17.1 deg
Focal Length                    : 9.0 mm (35 mm equivalent: 120.0 mm)
GPS Position                    : 48 deg 47' 19.11" N, 2 deg 2' 20.46" E
Hyperfocal Distance             : 17.97 m
Light Value                     : 0.0
Comment 1 Maik Qualmann 2025-11-01 16:29:22 UTC
Even though we've delegated many jobs to ExifTool, we still use Exiv2 internally to decode the metadata. Unfortunately, Exiv2 has a problem with the image and generates an exception:

digikam.metaengine: Exiv2 ( 3 ) :  Directory Image: Next pointer is out of bounds; ignored.
digikam.metaengine: Exiv2 ( 3 ) :  Upper boundary of data for directory Photo, entry 0x927c is out of bounds: Offset = 0x0000030a, size = 65564, exceeds buffer size by 815 Bytes; truncating the entry
digikam.metaengine: Exiv2 ( 3 ) :  Offset of directory Photo, entry 0xa404 is out of bounds: Offset = 0x00010326; truncating the entry
digikam.metaengine: Exiv2 ( 3 ) :  Directory Image, entry 0x8825 Sub-IFD pointer 0 is out of bounds; ignoring it.

This exception comes from the EXV container created by ExifTool. Exiv2 wouldn't find any metadata directly in the image.

Maik
Comment 2 caulier.gilles 2025-11-01 16:55:11 UTC
@ jblum66,

This problem must be reported to Exiv2 project as UPSTREAM bug at this place :

https://github.com/Exiv2/exiv2/issues

Best regards

Gilles Caulier
Comment 3 Maik Qualmann 2025-11-01 17:02:08 UTC
According to ExifTool validation, the image has 67 warnings! The GPS data is also incorrect.

Is this an unedited image from a Xiaomi smartphone?

Maik
Comment 4 jblum66 2025-11-01 17:38:38 UTC
Created attachment 186393 [details]
Original file from the smartphone
Comment 5 jblum66 2025-11-01 17:43:43 UTC
(In reply to Maik Qualmann from comment #3)
> According to ExifTool validation, the image has 67 warnings! The GPS data is
> also incorrect.
> 
> Is this an unedited image from a Xiaomi smartphone?
> 
> Maik

I posted the original file again, but you're right indeed:

H:\Program Files\exiftool>exiftool -validate -warning -error -a C:\Users\jerome\Downloads\IMG_20251011_222520_original.HEIC
Validate                        : 67 Warnings (29 minor)
Warning                         : [minor] Non-standard IFD0 tag 0x9999 XiaomiSettings
Warning                         : Entries in IFD0 are out of order [x6]
Warning                         : [minor] Unknown IFD0 tag 0x889a
Warning                         : Tag ID 0x889a out of sequence in IFD0
Warning                         : Tag ID 0x0101 ImageHeight out of sequence in IFD0
Warning                         : [minor] Odd offset for IFD0 tag 0x0132 ModifyDate
Warning                         : [minor] Odd offset for GPS tag 0x0002 GPSLatitude
Warning                         : [minor] Odd offset for GPS tag 0x0006 GPSAltitude
Warning                         : Entries in GPS are out of order [x5]
Warning                         : Tag ID 0x0001 GPSLatitudeRef out of sequence in GPS
Warning                         : [minor] Odd offset for GPS tag 0x000d GPSSpeed
Warning                         : Tag ID 0x0005 GPSAltitudeRef out of sequence in GPS
Warning                         : Non-standard format (string) for GPS 0x001b GPSProcessingMethod
Warning                         : [minor] Odd offset for GPS tag 0x001b GPSProcessingMethod
Warning                         : Tag ID 0x000c GPSSpeedRef out of sequence in GPS
Warning                         : Tag ID 0x0003 GPSLongitudeRef out of sequence in GPS
Warning                         : [minor] Odd offset for GPS tag 0x0007 GPSTimeStamp
Warning                         : [minor] Odd offset for GPS tag 0x0004 GPSLongitude
Warning                         : Tag ID 0x0004 GPSLongitude out of sequence in GPS
Warning                         : [minor] Odd offset for GPS tag 0x001d GPSDateStamp
Warning                         : [minor] Odd offset for IFD0 tag 0x011b YResolution
Warning                         : Tag ID 0x011b YResolution out of sequence in IFD0
Warning                         : [minor] Odd offset for IFD0 tag 0x011a XResolution
Warning                         : Tag ID 0x011a XResolution out of sequence in IFD0
Warning                         : [minor] Unknown IFD0 tag 0x88a3
Warning                         : Tag ID 0x0100 ImageWidth out of sequence in IFD0
Warning                         : [minor] Odd offset for IFD0 tag 0x0110 Model
Warning                         : Non-standard format (string) for ExifIFD 0x9000 ExifVersion
Warning                         : [minor] Odd offset for ExifIFD tag 0x9202 ApertureValue
Warning                         : Non-standard format (int8u) for ExifIFD 0xa301 SceneType
Warning                         : Entries in ExifIFD are out of order [x16]
Warning                         : [minor] Non-standard ExifIFD tag 0x9999 XiaomiSettings
Warning                         : [minor] Odd offset for ExifIFD tag 0x9999 XiaomiSettings
Warning                         : Tag ID 0x9999 XiaomiSettings out of sequence in ExifIFD
Warning                         : [minor] Unknown ExifIFD tag 0x889e
Warning                         : [minor] Odd offset for ExifIFD tag 0x889e
Warning                         : Tag ID 0x889e out of sequence in ExifIFD
Warning                         : Tag ID 0x8822 ExposureProgram out of sequence in ExifIFD
Warning                         : [minor] Unknown ExifIFD tag 0x889a
Warning                         : Tag ID 0x889a out of sequence in ExifIFD
Warning                         : Tag ID 0x9203 BrightnessValue out of sequence in ExifIFD
Warning                         : Tag ID 0x9003 DateTimeOriginal out of sequence in ExifIFD
Warning                         : [minor] Unknown ExifIFD tag 0xa661
Warning                         : Tag ID 0x927c MakerNoteUnknown out of sequence in ExifIFD
Warning                         : [minor] Suspicious MakerNotes offset for tag 0x4d4d
Warning                         : [Minor] Not decoding some large array(s). Ignore minor errors to decode
Warning                         : Tag ID 0xa005 InteropOffset out of sequence in ExifIFD
Warning                         : Tag ID 0x829a ExposureTime out of sequence in ExifIFD
Warning                         : [minor] Odd offset for ExifIFD tag 0x829d FNumber
Warning                         : Tag ID 0x829d FNumber out of sequence in ExifIFD
Warning                         : Tag ID 0x8827 ISO out of sequence in ExifIFD
Warning                         : [minor] Odd offset for ExifIFD tag 0x9012 OffsetTimeDigitized
Warning                         : Tag ID 0x9012 OffsetTimeDigitized out of sequence in ExifIFD
Warning                         : Tag ID 0x9292 SubSecTimeDigitized out of sequence in ExifIFD
Warning                         : Tag ID 0x9004 CreateDate out of sequence in ExifIFD
Warning                         : [minor] Unknown ExifIFD tag 0x8895
Warning                         : Tag ID 0x8895 out of sequence in ExifIFD
Warning                         : Tag ID 0x9208 LightSource out of sequence in ExifIFD
Warning                         : Tag ID 0x0128 ResolutionUnit out of sequence in IFD0
Warning                         : [minor] Non-standard IFD0 tag 0x9a00 XiaomiModel
Warning                         : [minor] Odd offset for IFD0 tag 0x9a00 XiaomiModel
Warning                         : Entries in IFD1 are out of order [x4]
Warning                         : Tag ID 0x0103 Compression out of sequence in IFD1
Warning                         : Tag ID 0x011a XResolution out of sequence in IFD1
Warning                         : Tag ID 0x0110 Model out of sequence in IFD1
Warning                         : Tag ID 0x010f Make out of sequence in IFD1
Warning                         : [minor] Odd offset for IFD1 tag 0x0132 ModifyDate

But there is no error and ExifTool does retrieve the EXIF metadata.
Comment 6 jblum66 2025-11-01 17:43:43 UTC
(In reply to Maik Qualmann from comment #3)
> According to ExifTool validation, the image has 67 warnings! The GPS data is
> also incorrect.
> 
> Is this an unedited image from a Xiaomi smartphone?
> 
> Maik

I posted the original file again, but you're right indeed:

H:\Program Files\exiftool>exiftool -validate -warning -error -a C:\Users\jerome\Downloads\IMG_20251011_222520_original.HEIC
Validate                        : 67 Warnings (29 minor)
Warning                         : [minor] Non-standard IFD0 tag 0x9999 XiaomiSettings
Warning                         : Entries in IFD0 are out of order [x6]
Warning                         : [minor] Unknown IFD0 tag 0x889a
Warning                         : Tag ID 0x889a out of sequence in IFD0
Warning                         : Tag ID 0x0101 ImageHeight out of sequence in IFD0
Warning                         : [minor] Odd offset for IFD0 tag 0x0132 ModifyDate
Warning                         : [minor] Odd offset for GPS tag 0x0002 GPSLatitude
Warning                         : [minor] Odd offset for GPS tag 0x0006 GPSAltitude
Warning                         : Entries in GPS are out of order [x5]
Warning                         : Tag ID 0x0001 GPSLatitudeRef out of sequence in GPS
Warning                         : [minor] Odd offset for GPS tag 0x000d GPSSpeed
Warning                         : Tag ID 0x0005 GPSAltitudeRef out of sequence in GPS
Warning                         : Non-standard format (string) for GPS 0x001b GPSProcessingMethod
Warning                         : [minor] Odd offset for GPS tag 0x001b GPSProcessingMethod
Warning                         : Tag ID 0x000c GPSSpeedRef out of sequence in GPS
Warning                         : Tag ID 0x0003 GPSLongitudeRef out of sequence in GPS
Warning                         : [minor] Odd offset for GPS tag 0x0007 GPSTimeStamp
Warning                         : [minor] Odd offset for GPS tag 0x0004 GPSLongitude
Warning                         : Tag ID 0x0004 GPSLongitude out of sequence in GPS
Warning                         : [minor] Odd offset for GPS tag 0x001d GPSDateStamp
Warning                         : [minor] Odd offset for IFD0 tag 0x011b YResolution
Warning                         : Tag ID 0x011b YResolution out of sequence in IFD0
Warning                         : [minor] Odd offset for IFD0 tag 0x011a XResolution
Warning                         : Tag ID 0x011a XResolution out of sequence in IFD0
Warning                         : [minor] Unknown IFD0 tag 0x88a3
Warning                         : Tag ID 0x0100 ImageWidth out of sequence in IFD0
Warning                         : [minor] Odd offset for IFD0 tag 0x0110 Model
Warning                         : Non-standard format (string) for ExifIFD 0x9000 ExifVersion
Warning                         : [minor] Odd offset for ExifIFD tag 0x9202 ApertureValue
Warning                         : Non-standard format (int8u) for ExifIFD 0xa301 SceneType
Warning                         : Entries in ExifIFD are out of order [x16]
Warning                         : [minor] Non-standard ExifIFD tag 0x9999 XiaomiSettings
Warning                         : [minor] Odd offset for ExifIFD tag 0x9999 XiaomiSettings
Warning                         : Tag ID 0x9999 XiaomiSettings out of sequence in ExifIFD
Warning                         : [minor] Unknown ExifIFD tag 0x889e
Warning                         : [minor] Odd offset for ExifIFD tag 0x889e
Warning                         : Tag ID 0x889e out of sequence in ExifIFD
Warning                         : Tag ID 0x8822 ExposureProgram out of sequence in ExifIFD
Warning                         : [minor] Unknown ExifIFD tag 0x889a
Warning                         : Tag ID 0x889a out of sequence in ExifIFD
Warning                         : Tag ID 0x9203 BrightnessValue out of sequence in ExifIFD
Warning                         : Tag ID 0x9003 DateTimeOriginal out of sequence in ExifIFD
Warning                         : [minor] Unknown ExifIFD tag 0xa661
Warning                         : Tag ID 0x927c MakerNoteUnknown out of sequence in ExifIFD
Warning                         : [minor] Suspicious MakerNotes offset for tag 0x4d4d
Warning                         : [Minor] Not decoding some large array(s). Ignore minor errors to decode
Warning                         : Tag ID 0xa005 InteropOffset out of sequence in ExifIFD
Warning                         : Tag ID 0x829a ExposureTime out of sequence in ExifIFD
Warning                         : [minor] Odd offset for ExifIFD tag 0x829d FNumber
Warning                         : Tag ID 0x829d FNumber out of sequence in ExifIFD
Warning                         : Tag ID 0x8827 ISO out of sequence in ExifIFD
Warning                         : [minor] Odd offset for ExifIFD tag 0x9012 OffsetTimeDigitized
Warning                         : Tag ID 0x9012 OffsetTimeDigitized out of sequence in ExifIFD
Warning                         : Tag ID 0x9292 SubSecTimeDigitized out of sequence in ExifIFD
Warning                         : Tag ID 0x9004 CreateDate out of sequence in ExifIFD
Warning                         : [minor] Unknown ExifIFD tag 0x8895
Warning                         : Tag ID 0x8895 out of sequence in ExifIFD
Warning                         : Tag ID 0x9208 LightSource out of sequence in ExifIFD
Warning                         : Tag ID 0x0128 ResolutionUnit out of sequence in IFD0
Warning                         : [minor] Non-standard IFD0 tag 0x9a00 XiaomiModel
Warning                         : [minor] Odd offset for IFD0 tag 0x9a00 XiaomiModel
Warning                         : Entries in IFD1 are out of order [x4]
Warning                         : Tag ID 0x0103 Compression out of sequence in IFD1
Warning                         : Tag ID 0x011a XResolution out of sequence in IFD1
Warning                         : Tag ID 0x0110 Model out of sequence in IFD1
Warning                         : Tag ID 0x010f Make out of sequence in IFD1
Warning                         : [minor] Odd offset for IFD1 tag 0x0132 ModifyDate

But there is no error and ExifTool does retrieve the EXIF metadata.
Comment 7 Maik Qualmann 2025-11-01 18:06:26 UTC
The problem is the MakerNotes; ExifTool can't repair them. They're always copied unchanged as a block, and they're read-only in ExifTool.

However, we can omit them in a second reading attempt. I've already tested this here, and we then at least have Exif data with GPS.

Maik
Comment 8 Maik Qualmann 2025-11-01 19:21:30 UTC
Git commit ff06620088214ec3a65d10aab16c81b8c62bb31a by Maik Qualmann.
Committed on 01/11/2025 at 19:20.
Pushed by mqualmann into branch 'master'.

workaround for read problematic makernotes with Exiv2
FIXED-IN: 8.9.0

M  +1    -1    NEWS
M  +35   -20   core/libs/metadataengine/dmetadata/dmetadata_exiftool.cpp
M  +19   -2    core/libs/metadataengine/engine/metaengine.cpp
M  +3    -1    core/libs/metadataengine/exiftool/exiftoolparser.h
M  +6    -1    core/libs/metadataengine/exiftool/exiftoolparser_command.cpp

https://invent.kde.org/graphics/digikam/-/commit/ff06620088214ec3a65d10aab16c81b8c62bb31a
Comment 9 jblum66 2025-11-05 08:30:16 UTC
I confirm it works. I used the maintenance tool to synchronize the metadata from the images to the database, and the coordinates and elevation were retrieved correctly. Thank you for your help.