GPS tags not existing or writable for CR3 files

Started by Kottan, January 25, 2024, 03:59:50 PM

Previous topic - Next topic

Kottan

I am using Exiftool a while in connection with other software like GPSBabel, but I just start diving in the details of GPS metadata handling. Now, I am struggling with a problem I can't solve by my own:
I took pictures with a new Canon R6 with and without GPS-E2 device connected, so I have different sets of GPS data depending on whether the GPS-E2 was connected at the time I took the picture or not.

For RAW format pictures (.CR3 format) taken without GPS-E2, I miss the following tags: GPS Time Stamp, GPS Map Datum, GPS Date Stamp and GPS Date/Time.

In order to add the missing GPS data in those pictures taken without the GPS-E2, I followed an earlier post in this forum and tried to generate two tags: composite:GPSdateStamp and composite:GPStimeStamp. However, I get a warning "Sorry, composite:GPSdateStamp doesn't exist or isn't writable", the same for the tag composite:GPStimeStamp.

The command line was as follows:
"C:\...\exiftool.exe" -composite:GPSdatestamp="2023:01:25" -composite:GPStimestamp="08:00:00" "C:\Users\...\Test_Image.cr3", where "..." stands for the correct paths.

What am I doing wrong? Any idea? Help would be highly appreciated. 
kind regards
Kottan

Phil Harvey

Hi Kottan,

Try specifying the GPS group instead of Composite.

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

Kottan

#2
Hi Phil,

Wow, the master himself! Tthat's what I call a quick answer ;)
Will try immediately.
So there is no reason why this action shouldn't work with .cr3 files, right?

Update #1:
I have modified the command now to "-GPS:datestamp="2023:01:25" -GPS:timestamp="08:00:00"
Return messages read:  "Warning: Tag 'GPS:datestamp' is not defined" and again "Warning: Sorry, GPS:TimeStamp doesn't exist or isn't writable"

Update #2:
Second try: I changed the tags to "-GPS:gpsdatestamp="2023:01:25" -GPS:gpstimestamp="08:00:00" . This time, I got a message "1 image files updated" and it seems to work. I will check with further image files to verify this.
kind regards
Kottan

Kottan

Now, as it seems to work basically, I would like to make the next step.
For pictures not automatically geotagged I am using the freeware GeoSetter 3.5.3. Unfortunately, the guy who invented it does not support it any longer, the version did not change since 2019 and, as a result, I can't tag my CR3 files with this software but only the .JPG ones.

My planned workaround to add GPS data to my "non-geotagged" RAW files is to copy the GPS information from the manually geotagged JPG image files to the CR3 files in one go.

I am sure this work can be automated using a script/batch operation? As I am not familiar with scripting in connection with exiftool, does anybody have a recommendation or a link for me?
kind regards
Kottan

Phil Harvey

You shouldn't need to write a script.  Something like this should copy the GPS information from CR3 to JPG if it doesn't exist already:

exiftool -if "not $gpslatitude" -tagsfromfile %d%f.CR3 -gps:all -ext jpg -r DIR

I'm testing for $gpslatitude here instead of $gps:all because some cameras write GPSVersionID even if they don't write the coordinates.

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

Kottan

#5
Phil wrote:
QuoteSomething like this should copy the GPS information from CR3 to JPG if it doesn't exist already

It's the other way around, from JPG to CR3, but I do understand your point.
It would then read

exiftool -if "not $gpslatitude" -tagsfromfile %d%f.JPG -gps:all -ext CR3 -r DIR
Am I right?
Will test it.

Maybe for those who are interested in my current background:
The last days, I read a lot about synchronization of GPS data as well as GPS timestamp data. I am looking for a smart method to speed up this task instead of doing it manually, which may be time consuming, but it takes time to verify the information provided by those authors.
In particular, I need to create GPS data (coordinates, date/time) manually if the track, e.g. a city walk, is not tracked by any device (camera, separate tracker like Canon's GPS-E2, Garmin GPS device etc.). I can also imagine a split in my task like this:
  • copy date/time from existing image date/time tag to GPS date/time tag in order to synchronize it. Another option would be to modify the GPS timestamp of a recorded track accordingly
  • Input GPS coordinates (latitude, longitude, Reference values) manually

kind regards
Kottan

Kottan

#6
At first, I made a stupid mistake and thought it might not work. >:(
But now it's fine. Thanks!
kind regards
Kottan

Kottan

As the files with different extension are stored in different directories, I would like to copy the GPS data (date/time, latitude, longitude, altitude if necessary) from .jpg files in directory A to .raw files in directory B.

I understand that the code "%d%f" defines both directory and filename.
How must it read, if the files are in different directories, provided that the filenames are identical for both .jpg and .raw?

kind regards
Kottan

Phil Harvey

%d is the directory part.  %f is the file name.  Change the %d to another directory name (ending with "/") if it is different than the source.

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

Kottan

Thanks Phil,

Got it. I have modified your initial command proposal - it works with different directories now.

May I ask another question related to this?
Whilst checking the exiftool documentation, I couldn't find details about the use of "%", operators and conditions as in your proposal. In the FAQ, there are some examples, but I miss a complete documentation. As exiftool is written in Perl, which I am not familiar with: Can you recommend a source where I can find more details to better customize my exiftool controlled metadata operations? Thanks a lot in advance :)

kind regards
Kottan

StarGeek

Quote from: Kottan on January 31, 2024, 03:58:43 AMWhilst checking the exiftool documentation, I couldn't find details about the use of "%", operators

I almost posted the link yesterday. You can find details on the % variables under the -w (-TextOut) option.  It is referred to under the -TagsFromFile option, 3rd paragraph.  I'm pretty sure any other option that uses them also refers to the -w (-TextOut) option.

QuoteAs exiftool is written in Perl, which I am not familiar with: Can you recommend a source where I can find more details to better customize my exiftool controlled metadata operations?

I mostly learned Perl by searching on "Perl" and what I was attempting to do. The StackExchage sites usually pull up a code snippet that could accomplish it.  For more details and refreshers, I usually look over PerlMaven.

I tend to find PerlDoc.Perl.org a bit too technical to figure things out and the formatting of PerlMonks.org harder to read, but those would be the major Perl sources.

RegEx is featured heavily in Perl and various commands here and a whole separate field to learn.  I used Regular-Expressions.info to learn and RegEx101.com to test expressions.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).