smarnach / pyexiftool

a Python library to communicate with an instance of Phil Harvey's excellent ExifTool command-line application.
Other
270 stars 111 forks source link

OSError when passing config file to exiftool #9

Open alexbruy opened 11 years ago

alexbruy commented 11 years ago

When I try to init exiftool with custom config-file that describes some additional user tags I get this error:

  File "/home/alex/.qgis2/python/plugins/geotagphotos/exiftool.py", line 193, in __enter__
    self.start()
  File "/home/alex/.qgis2/python/plugins/geotagphotos/exiftool.py", line 176, in start
    stderr=devnull)
  File "/usr/lib64/python2.7/subprocess.py", line 679, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.7/subprocess.py", line 1249, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Here is my simplified code:

etPath = "exiftool"
cfgFile = "/path/to/config/file"
etPath += " -config " + unicode(cfgFile)
et = exiftool.ExifTool(etPath)
with et:
  md = et.get_metadata("/path/to/photo")
  print md

Sample files:

alexbruy commented 11 years ago

Forgot to say, that this code worked previously, but now master crashes

alexbruy commented 11 years ago

Just tested pull-request #5. When passing additional options using new optional parameter addedargs all works fine. @smarnach any chance to merge it?