0

I would like to call exiftool in Windows 7 from within a python script to both extract and add info to the image tags, but I'm stumbling over the basic workflow to do this. This question and answer addresses this topic, but I have a couple of basic questions regarding it and am unable to comment on the original question:

  1. Where on my system should the executable be stored?
  2. What does the *filenames bit do?
  3. Can I just specify a list of files in place of *filenames in the 'with ExifTool()' bit, or should I just leave it as is and make sure my directory with my images is my cwd?

Any help is appreciated!

Community
  • 1
  • 1
Crazy Otto
  • 125
  • 2
  • 13

1 Answers1

0
  1. The executable can be stored anywhere on your system - just make sure to pass the path to the ExifTool constructor when you create it:

    with ExifTool('') as e: metadata = e.get_metadata(*filenames)

  2. *filenames is syntax for "exploding" a list (in this example). Rather than passing a single list with filenames to the self.execute call, we pass all the filenames as part of the *args.

  3. You can specify a list of filenames if you want - filenames just needs to be a list of paths for exiftool to process.

vikramls
  • 1,802
  • 1
  • 11
  • 15
  • Thank you for the clarification...although the script appears to hang. However, when I use the example posted [here](http://smarnach.github.io/pyexiftool/) with the appropriate class, it works. – Crazy Otto Dec 05 '14 at 09:46
  • One more thing: it looks like this class can only extract metadata, but not edit it -- anybody have any experience extending it for editing? – Crazy Otto Dec 05 '14 at 11:57