Composite GPS tags

Started by wywh, January 16, 2022, 07:41:49 AM

Previous topic - Next topic

wywh

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

StarGeek

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
     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 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.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

StarGeek

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.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Phil Harvey

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
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

wywh

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