ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: wywh on January 16, 2022, 07:41:49 AM

Title: Composite GPS tags
Post by: wywh on January 16, 2022, 07:41:49 AM
It seems that with exiftool 12.36 or later it is possible to copy Google Maps GPS format '-36.6101, -66.91515' and paste it to a .jpg by simply:

exiftool -n -Composite:GPSPosition='-36.6101, -66.91515' image.jpg

which is much simpler than the old command like:

exiftool '-GPSLatitude<${coords;s/,.*//}' '-GPSLatitudeRef<${coords;s/,.*//}' '-GPSLongitude<${coords;s/.*,//}' '-GPSLongitudeRef<${coords;s/.*, //}' -userParam coords='-36.6101, -66.91515' image.jpg

It seems that -n (No print conversion) must be added because otherwise:

exiftool -Composite:GPSPosition='-36.6101, -66.91515' image.jpg
Warning: Undefined subroutine &Image::ExifTool::GPS::ToDegrees called in Composite:GPSPosition (PrintConvInv)
Nothing to do.


Movies (.mp4, .m4v, .mov) already supported Google Maps GPS format (although Google Photos might not show positions in decimal degrees with more than 5 decimals after the dot...):

exiftool -Keys:GPSCoordinates='-36.6101, -66.91515' movie.mp4

BTW are Composite tags "real" or are they generated on-the-fly by exiftool and their display can just be disabled with -e?

Are there some other uses for the newly supported writable Composite tags?

Can Composite GPS tags be used to bypass the Apple Photos.app flaw in .xmp image and movie references?

https://exiftool.org/forum/index.php?topic=11969.msg64879#msg64879

https://exiftool.org/forum/index.php?topic=13167.msg71183#msg71183

- Matti
Title: Re: Composite GPS tags
Post by: StarGeek on January 16, 2022, 10:50:11 AM
Quote from: wywh on January 16, 2022, 07:41:49 AM
BTW are Composite tags "real" or are they generated on-the-fly by exiftool and their display can just be disabled with -e?

From the Composite tags page (https://exiftool.org/TagNames/Composite.html)
     The values of the composite tags are Derived From the values of other tags. These are convenience tags which are calculated after all other information is extracted.

They do not actually exist in the file.  And -e (--composite) option (https://exiftool.org/exiftool_pod.html#e---composite) disables them.

QuoteCan Composite GPS tags be used to bypass the Apple Photos.app flaw in .xmp image and movie references?

No, because none of the Composite tags read the XMP Latitude/Longitude ref tags.  See the above link to Composite tags to see what tags are actually read to create them.
Title: Re: Composite GPS tags
Post by: StarGeek on January 16, 2022, 11:00:50 AM
Quote from: wywh on January 16, 2022, 07:41:49 AM
It seems that -n (No print conversion) must be added because otherwise:

exiftool -Composite:GPSPosition='-36.6101, -66.91515' image.jpg
Warning: Undefined subroutine &Image::ExifTool::GPS::ToDegrees called in Composite:GPSPosition (PrintConvInv)
Nothing to do.

Something changed between ver 12.38 and 12.39.  The fix for writing DMS format coordinates broke writing decimal coordinates.  I believe Phil said somewhere that the reason to make this tag writable was to make it easier to copy/paste coordinates from Google maps.
Title: Re: Composite GPS tags
Post by: Phil Harvey on January 16, 2022, 05:24:22 PM
Hi Matti,

Quote from: wywh on January 16, 2022, 07:41:49 AM
exiftool -Composite:GPSPosition='-36.6101, -66.91515' image.jpg
Warning: Undefined subroutine &Image::ExifTool::GPS::ToDegrees called in Composite:GPSPosition (PrintConvInv)
Nothing to do.

Thanks for pointing this out.  It wasn't giving me this error because of the effect of my config file.  I'll fix this.

- Phil
Title: Re: Composite GPS tags
Post by: wywh on February 10, 2022, 04:31:29 AM
Quote from: Phil Harvey on January 16, 2022, 05:24:22 PM
It wasn't giving me this error because of the effect of my config file.  I'll fix this.

Thanks, in exiftool v12.40 this simple command now works OK with locations copied from Google Maps (I usually crop it to 5 decimals because Google Photos might not work with more):

exiftool -Composite:GPSPosition='-36.6101, -66.91515' image.jpg

- Matti