Skip to content

Read from BytesIO image? #33

@apiszcz

Description

@apiszcz

Is it possible to retrieve exiftools metadata from a BytesIO object? I am trying the following, with error below.

img = Image.open('bus.jpg')
buf = io.BytesIO()
img.save(buf, 'jpeg')
imgbytes = buf.getvalue()
exif = exiftool.ExifTool.get_metadata(imgbytes)
pprint.pprint(exif)
 testexif.py
Traceback (most recent call last):
  File "C:\test\testexif.py", line 8, in <module>
    exif = exiftool.ExifTool.get_metadata(imgbytes)
TypeError: get_metadata() missing 1 required positional argument: 'filename'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions