Install and use exiftool on windows to modify image exif information

  Use exiftool to read, modify and write the exif information of the image. It can be installed directly through the command line on the Linux system, which is very convenient. But on Windows, I read this blog at the beginning , and felt that it was written in great detail, so I followed suit. It says that you need to install perl first, and perl needs to be downloaded from the official website to register and log in with an account, then install it, and then download the exiftool toolkit or something, which is relatively cumbersome.
  Later, because the download of the exiftool toolkit was too slow, I found that it was enough to download the exe file directly (it is estimated that there is no need to install the perl in advance, because it is written that perl is not needed when the exe file is downloaded), which is the following: after downloading and decompressing, there is such a thing (originally named, I renamed it): we do not need to double-click to run it, but to use it and the command
insert image description here
  to exiftool(-k).exeexecute
insert image description here
  . For example, the code (python) I originally wanted to write GPS information into the image file is:

commonline = "exiftool -XMP:GPSLongitude=\"{0}\"  -XMP:GPSLatitude=\"{1}\" -XMP:GPSAltitude=\"{2}\"   -GPSLongitudeRef=\"East\" -GPSLatitudeRef=\"North\" -P {3}".format(tmpLon,tmpLat,tmpHeight,file) 
os.system(commandLine)

  This is the code executed on ubuntu, and to execute this command through the exe file we downloaded, just change it to the following (that is, give the path of the exe):

commonline = "F:/Desktop/exiftool.exe -XMP:GPSLongitude=\"{0}\"  -XMP:GPSLatitude=\"{1}\" -XMP:GPSAltitude=\"{2}\"   -GPSLongitudeRef=\"East\" -GPSLatitudeRef=\"North\" -P {3}".format(tmpLon,tmpLat,tmpHeight,file) 
os.system(commandLine)

Guess you like

Origin blog.csdn.net/weixin_44120025/article/details/128506125