How to copy AmbientTemperature from .gpx track to jpeg file metadata

Started by JerryRaack, March 03, 2019, 03:34:06 PM

Previous topic - Next topic

JerryRaack

I'm new to this forum, but have used  exiftool for a number of things.  I regularly go into South America looking for new species of plants.  I document my searches by recording my tracks with a Garmin 550t GPS device (.gpx files), and thousands of photographs (both RAW and JPEG format).  I know how to use geotag to copy the GPS Latitude, Longitude and Elevation from the track file into the JPEG data.  I recently added an Ambient Temperature sensor to my Garmin 550t using bluetooth, and it also now records the Ambient Temperature in the .gpx track log.   How can I use the geotag feature of exiftool to extract the relevant ambient temperature from the correct .gpx trk entry and put that temperature data into the AmbientTemperature field of the corresponding JPEG file (Tag ID: 0x9400, Tag Name: AmbientTemperature, Writeable: rational64s, Group: ExiflFD, Value: degrees C)?   I have a directory for each trip, with a subdirectory for each day of travel.   Each subdirectory has a .gpx track file and a large number of picture files taken on that day.   Thanks in advance for any help anyone can provide.   (P.S. I looked for all forum entries containing the word Temperature and have already read them, but could find nothing about my subject.)
Jerry Raack

Phil Harvey

Hi Jerry,

I would need to modify the ExifTool GPX reader to look for temperature data.  Could you post or email (philharvey66 at gmail.com) a sample GPX with temperatures and I'll see about adding this ability.

- 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 ($).

JerryRaack

Phil,
Thanks for agreeing to take a look at this.   I sent a set of 6 photos and the .gpx file to you today via email.
Jerry
Jerry Raack

Phil Harvey

I got the files, thanks.

ExifTool 11.30 (likely to be released in a few days) will have the ability to write the EXIF/XMP AmbientTemperature tag from GPX track logs such as 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 ($).

Phil Harvey

...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 ($).

JerryRaack

Phil,
    Fantastic!   Works perfectly.   I used it to do about 1800 pictures in 9 directories today.   Only thing I saw was that I got a minor
warning message for each file it read as follows:
"Warning: [minor] Error reading PreviewImage from file - ./P1311612.jpg"

But, it worked and copied all the GPS data, Elevation and Temperature to the EXIF metadata of the files from my Track file (.gpx)

THANK YOU SO MUCH!!!!
Jerry
Jerry Raack

Phil Harvey

Hi Jerry,

Glad it worked for you.

The PreviewImage warning is a common problem.  Most image editing programs will remove the preview image, and some cameras write it improperly, either of which may cause this warning.  You may ignore minor warnings like this with the -m option.

- 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 ($).