batch editing of exif info

Started by Lebreton, February 08, 2022, 11:40:31 AM

Previous topic - Next topic

Lebreton

Hi,
I use exiftool version 12.39 from Windows Powershell and I am trying to write GPS coordinates in the EXIF data of a series of jpg files.
After many attempts I still hit the same problem several users already had. The Sourcefile information in my csv file is not correctly interpreted.
I am in the good directory (after a cd command), the jpg files are there, and I get the message (one for each jpg file)

No Sourcefile './Herbier_0001_Pedicularis_pyrenaica.jpg' in imported CSV database'.
(full path: 'C:/LEBRETON/SCIENCES_NAT/HERBIER/Herbier_0001_Pedicularis_pyrenaica.jpg')

Here is my command line in the Windows Powershell
.\exiftool -csv=herbier_for_exif.txt .

Here are the first few lines of my csv file:
Sourcefile,Datetimeoriginal,GPSLatitude,GPSLongitude,GPSAltitude
C:/LEBRETON/SCIENCES_NAT/HERBIER/Herbier_0001_Pedicularis_pyrenaica.jpg,27/06/2010,42.56375885,1.983549953,2200
C:/LEBRETON/SCIENCES_NAT/HERBIER/Herbier_0002_Pedicularis_comosa.jpg,22/05/2004,44.96697998,6.53798008,1450
C:/LEBRETON/SCIENCES_NAT/HERBIER/Herbier_0003_Pedicularis_tuberosa.jpg,27/07/2009,45.8335495,7.293059826,2470
C:/LEBRETON/SCIENCES_NAT/HERBIER/Herbier_0004_Pedicularis_verticillata.jpg,03/08/2002,45.02701187,6.485370159,2300

I tried all possible combinations for the Sourcefile names : just the filenames, './' before the file names, full path (as shown above), idem with backslash, ... and always get the same messages
Thanks in advance for any advice,
Jean-Dominique

StarGeek

I believe you missed the first error line.  Duplicating your example, the first error is Error opening CSV file 'herbier_for_exif'.  This is why it's important to copy/paste the full command and output.

It's also important to look at the highlighting when it comes to Powershell.  Powershell has a lot of stupid idiosyncrasies that are unlike any other command line, including corrupting binary data.  If you look carefully, you'll see that there is different highlighting for the TXT extension.


There is no problem when running the command in CMD.
C:\LEBRETON\SCIENCES_NAT\HERBIER>exiftool -csv=herbier_for_exif.txt .
    1 directories scanned
    4 image files updated

C:\LEBRETON\SCIENCES_NAT\HERBIER>exiftool -G1 -a -s -gps* .
======== ./Herbier_0001_Pedicularis_pyrenaica.jpg
[GPS]           GPSVersionID                    : 2.3.0.0
[GPS]           GPSLatitude                     : 42 deg 33' 49.53"
[GPS]           GPSLongitude                    : 1 deg 59' 0.78"
[GPS]           GPSAltitude                     : 2200 m
[Composite]     GPSPosition                     : 42 deg 33' 49.53", 1 deg 59' 0.78"
======== ./Herbier_0002_Pedicularis_comosa.jpg
[GPS]           GPSVersionID                    : 2.3.0.0
[GPS]           GPSLatitude                     : 44 deg 58' 1.13"
[GPS]           GPSLongitude                    : 6 deg 32' 16.73"
[GPS]           GPSAltitude                     : 1450 m
[Composite]     GPSPosition                     : 44 deg 58' 1.13", 6 deg 32' 16.73"
======== ./Herbier_0003_Pedicularis_tuberosa.jpg
[GPS]           GPSVersionID                    : 2.3.0.0
[GPS]           GPSLatitude                     : 45 deg 50' 0.78"
[GPS]           GPSLongitude                    : 7 deg 17' 35.02"
[GPS]           GPSAltitude                     : 2470 m
[Composite]     GPSPosition                     : 45 deg 50' 0.78", 7 deg 17' 35.02"
======== ./Herbier_0004_Pedicularis_verticillata.jpg
[GPS]           GPSVersionID                    : 2.3.0.0
[GPS]           GPSLatitude                     : 45 deg 1' 37.24"
[GPS]           GPSLongitude                    : 6 deg 29' 7.33"
[GPS]           GPSAltitude                     : 2300 m
[Composite]     GPSPosition                     : 45 deg 1' 37.24", 6 deg 29' 7.33"
======== ./herbier_for_exif.txt
    1 directories scanned
    5 image files read


Additionally, there's a problem with your CSV file.  You are setting the coordinates, but you are not setting the reference tags (see 4th paragraph on the GPS tags page). If all your coordinates are in the Northern and Eastern hemispheres, then the coordinates will probably be ok, but if any of them are in the Southern or Western hemispheres, then they won't be read correctly.  The easiest thing to do would be to open the CSV file in a spreadsheet, copy/paste the three coordinate columns, and append Ref to each of the column headers.

Sourcefile,Datetimeoriginal,GPSLatitude,GPSLongitude,GPSAltitude,GPSLatitudeRef,GPSLongitudeRef,GPSAltitudeRef
C:/LEBRETON/SCIENCES_NAT/HERBIER/Herbier_0001_Pedicularis_pyrenaica.jpg,27/06/2010,42.56375885,1.983549953,2200,42.56375885,1.983549953,2200
C:/LEBRETON/SCIENCES_NAT/HERBIER/Herbier_0002_Pedicularis_comosa.jpg,22/05/2004,44.96697998,6.53798008,1450,44.96697998,6.53798008,1450
C:/LEBRETON/SCIENCES_NAT/HERBIER/Herbier_0003_Pedicularis_tuberosa.jpg,27/07/2009,45.8335495,7.293059826,2470,45.8335495,7.293059826,2470
C:/LEBRETON/SCIENCES_NAT/HERBIER/Herbier_0004_Pedicularis_verticillata.jpg,03/08/2002,45.02701187,6.485370159,2300,45.02701187,6.485370159,2300


The final problem is with your timestamp.  It needs to be in order from year down to second Year Month Day Hour Minute Second.  It also needs the Hour Minute Second part.
"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