sylikc / pyexiftool

PyExifTool (active PyPI project) - A Python library to communicate with an instance of Phil Harvey's ExifTool command-line application. Runs one process with special -stay_open flag, and pipes data to/from. Much more efficient than running a subprocess for each command!
Other
161 stars 21 forks source link

Method names no longer exist in ExifTool class (in ExifToolHelper or ExifToolAlpha) #45

Closed fdarvas closed 2 years ago

fdarvas commented 2 years ago

The get_metadata(file) method seems to have gone missing from the current exiftool object?

The outlined example usage does no longer work.

import exiftool
files = ["a.jpg", "b.png", "c.tif"]
with exiftool.ExifToolHelper() as et:
        metadata = et.get_metadata(files)
sylikc commented 2 years ago

Uhm, I just tested and I'm pretty sure it's there (or else tests would fail). Are you using the latest v0.5.3 version? I ran this on the tests/images directory and it works just fine.

import exiftool
files = ["rose.jpg"]
with exiftool.ExifToolHelper() as et:
    print(et.get_metadata(files))

The get_metadata() function exists right here https://github.com/sylikc/pyexiftool/blob/master/exiftool/helper.py#L261

fdarvas commented 2 years ago

I see - it used to be:

with exiftool.ExifTool() as exift:
    exif = exift.get_metadata(files)

, so that caused the confusion

sylikc commented 2 years ago

Yes, so if you're a past user of the v0.4.x and previous PyExifTool. I broke the classes down.

This is mainly for maintainability, but it also allows adding extra features without breaking core ones

This will guide you to converting your code over. There are some other pretty big changes https://github.com/sylikc/pyexiftool/blob/master/COMPATIBILITY.txt#L15-L53