Skip to content

Cannot get exif data #6827

@nsosnsos

Description

@nsosnsos
#!/usr/bin/env python3
# -*- coding:utf-8 -*-

import sys
from PIL import Image, ExifTags


if __name__ == '__main__':
    image = Image.open(sys.argv[1])
    exif_info = image.getexif()
    exif_dict = {ExifTags.TAGS[tag]: value for tag, value in exif_info.items()}
    print(exif_dict)

What did you do?

call getexif interface

What did you expect to happen?

return full exif information.

What actually happened?

No exif data, return empty dict. Actually exif_info is an empty dict.

What are your OS, Python and Pillow versions?

  • OS: Ubuntu 22.04.1 LTS
  • Python: 3.10.6
  • Pillow: 9.3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions