GPS coordinate formatting in .bat file

Started by drsilver, August 27, 2021, 05:12:33 PM

Previous topic - Next topic

drsilver

I want a windows bat file that I can drag an image file to and have it display a defined list of exif tags and their values.

Money line in the bat file is:

exiftool.exe -@ tag_list.txt %1%

That line produces this:

File Name                       : _MG_8330.CR2
Create Date                     : 2021:05:05 11:29:41
Camera Model Name               : Canon EOS 6D Mark II
Lens ID                         : Canon EF 24-105mm f/4L IS USM
ISO                             : 100
Aperture                        : 5.6
Exposure Time                   : 1/400
Exposure Compensation           : 0
Focal Length                    : 40.0 mm
Exposure Program                : Aperture-priority AE
White Balance                   : Daylight
Color Temp As Shot              : 5200
Drive Mode                      : Single-frame Shooting
Continuous Drive                : Single
Metering Mode                   : Evaluative
Focus Mode                      : One-shot AF
Canon Flash Mode                : Off
Directory                       : E:/Photo/01_Keep/2021/210503-HYW2-East
File Type                       : CR2
Megapixels                      : 26.0
Quality                         : RAW
GPS Altitude                    : 799.1 m Above Sea Level
GPS Position                    : 47 deg 38' 48.32" N, 120 deg 4' 26.26" W

That's all perfect except that I want the GPS coordinates in a Google-Maps-readable format.

If I add the GPS coordinate formatting that I want, it all blows up.

exiftool.exe -c "%+.6f" -@ tag_list.txt %1%

It basically sees nothing after exiftool.exe. Running it fires up the man page like it received no arguments, tags or file names.

I use a similar command in a bash script on Windows Subsystem for Linux (WSL) and it reads the -c argument just fine.

exiftool.exe -c "%+.6f" -@ tag_list.txt $FILE

Produces a last line like
GPS Position                    : +46.375310, -120.191430

What can I do in the bat file to make it see the -c formatting?





StarGeek

Quote from: drsilver on August 27, 2021, 05:12:33 PMIf I add the GPS coordinate formatting that I want, it all blows up.

exiftool.exe -c "%+.6f" -@ tag_list.txt %1%

This is FAQ #27
* 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).