Error in output when some exif-data does not exist in a file

Started by pema_aarhus.dk, January 15, 2016, 04:20:36 AM

Previous topic - Next topic

pema_aarhus.dk

I use the following command line.  I use the -f option, as I would like to have a line in my outputfile also if the metadata does not exist in the file.

"exiftool.exe" -f -c "%%.6f" -Filename -GPSLOngitude -GPSLatitude -DateTimeOriginal -CreateDate "C:\MapInfo\fotos" > C:\MapInfo\fotos\exifdata.txt

I get the following output:

=========================================

======== C:/MapInfo/fotos/2012-08-15 15.22.20.jpg
File Name                       : 2012-08-15 15.22.20.jpg
GPSL Ongitude                   : -
GPS Latitude                    : -
Date Time Original              : -
Create Date                     : -
======== C:/MapInfo/fotos/2012-08-28 21.37.33.jpg
File Name                       : 2012-08-28 21.37.33.jpg
GPSL Ongitude                   : -
GPS Latitude                    : -
Date Time Original              : -
Create Date                     : -
======== C:/MapInfo/fotos/2014-08-03 21.10.44.jpg
File Name                       : 2014-08-03 21.10.44.jpg
GPS Longitude                   : 10.441715 E
GPS Latitude                    : 56.295265 N
Date/Time Original              : 2014:08:03 21:10:44
Create Date                     : 2002:12:08 12:00:00
======== C:/MapInfo/fotos/DJI_0275.JPG
File Name                       : DJI_0275.JPG
GPS Longitude                   : 10.520136 E
GPS Latitude                    : 56.101551 N
Date/Time Original              : 2015:11:15 13:35:47
Create Date                     : 2015:11:15 13:35:47


==========================================

The problem is that in case GPS coordinates does not exist, the  text "GPS Longitude" is written "GPSL Ongitude"
Se the 2 first files in the example above. There is no issue with "GPS Latutude"
There is the same issue with "Date/Time Original" ( "Date Time Original")

I have a program that needs the exact 'spelling'.

Phil Harvey

That is because you requested "GPSLOngitude".  Try changing this to "GPSLongitude" (lower case "o").  ExifTool doesn't know the proper case if it didn't find the tag, so it works with whatever you specified on the command line.  Notice also that you get back "Date Time Original" instead of "Date/Time Original".  If this is a problem, the only work-around I could suggest is to add the -s 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 ($).