ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: sebastianbarria on September 09, 2021, 08:28:13 AM

Title: Move GPS metadata from XMP to EXIF
Post by: sebastianbarria on September 09, 2021, 08:28:13 AM
Hi.
I have a lot of pictures with this problem:

If I search for the GPS information (exiftool file.jpg -gps* -G) , it exists in the XMP group, but not in the EXIF or COMPOSITE, so windows, qgis and even exiftoolGUI doesn't recognize it as geotagged.
So, the information is present in the image, but in the wrong location/group.

Is there any way to move the information (massively), like "exiftool file-jpg -XMP:gps*=COMPOSITE:gps*" ????
Please, help!

PS: I'm attaching one of the images here

Thanks!
Title: Re: Move GPS metadata from XMP to EXIF
Post by: StarGeek on September 09, 2021, 11:19:45 AM
What you'll want to do is download the xmp2gps.args (https://github.com/exiftool/exiftool/blob/master/arg_files/xmp2gps.args) file from github.  Place it in the same directory as exiftool and then you can run this command to copy the data
exiftool -TagsFromFile @ -@ xmp2gps.args /path/to/files/
Title: Re: Move GPS metadata from XMP to EXIF
Post by: sebastianbarria on September 09, 2021, 05:29:28 PM
Thanks @StarGeek.
I did execute the command, but I get this error:
Warning: No writable tags set from 1025944.jpg

And that warning is being shown on each file...
I don't know where's the problem... please, help!
Thanks!
Title: Re: Move GPS metadata from XMP to EXIF
Post by: StarGeek on September 09, 2021, 06:50:39 PM
Quote from: sebastianbarria on September 09, 2021, 05:29:28 PM
Warning: No writable tags set from 1025944.jpg

That tells you that there isn't any XMP GPS tags in that file.  Run this command to double check
exiftool -G1 -a -s -XMP:all 1025944.jpg

Are you sure that the data isn't in a XMP sidecar file instead?
Title: Re: Move GPS metadata from XMP to EXIF
Post by: sebastianbarria on September 10, 2021, 08:49:31 AM
Thanks Again StarGeek.

I did execute the command you said, and this was the result:
(I'm just pasting the GPS related tags)

[XMP-drone-dji] AbsoluteAltitude                : +486.09
[XMP-drone-dji] CamReverse                      : 0
[XMP-drone-dji] FlightPitchDegree               : -1.30
[XMP-drone-dji] FlightRollDegree                : +1.20
[XMP-drone-dji] FlightYawDegree                 : +97.20
[XMP-drone-dji] GimbalPitchDegree               : -90.00
[XMP-drone-dji] GimbalReverse                   : 0
[XMP-drone-dji] GimbalRollDegree                : +0.00
[XMP-drone-dji] GimbalYawDegree                 : +99.40
[XMP-drone-dji] GPSLatitude                     : 33 deg 26' 34.97" S
[XMP-drone-dji] GPSLongitude                    : 70 deg 48' 49.37" W
[XMP-drone-dji] RelativeAltitude                : +29.80


So, it seems it has the information in the XMP... I'm not sure how those tags got there
Cheers!
Title: Re: Move GPS metadata from XMP to EXIF
Post by: StarGeek on September 10, 2021, 10:16:57 AM
Ah, they are the dji drone tags, not the standard XMP-exif GPS tags.  That will require a minor edit to the xmp2gps.args file.

Open the args file up in a text editor like notepad.  There are three spots where it says XMP-exif.  Remove the -exif part so that it's just XMP, i.e. -GPS:all < XMP-exif:all becomes -GPS:all < XMP:all.

The next problem would be the GPS timestamps.  Run this command on the file and first check to see if GPS:GPSTimeStamp and GPS:GPSDateStamp are set correctly.  They should be set to UTC, not the local time of when the image was taken.
exiftool -time:all -g1 -a -s file.jpg

If they are not set, then look through the rest of the timestamps to see if there is one that is set to UTC.  You'll then want to copy that to the GPS timestamps.

Title: Re: Move GPS metadata from XMP to EXIF
Post by: sebastianbarria on September 13, 2021, 08:49:22 AM
Thanks a lot StatGeek!
That solved my problem.

Cheers!