File size: 380 Bytes
c9d5b11 |
1 2 3 4 5 6 7 8 9 10 11 |
import tempfile
import exiftool
from PIL import Image
def exif_full_dump(image: Image.Image) -> dict:
"""Extract all EXIF metadata from an image using exiftool."""
with tempfile.NamedTemporaryFile(suffix='.jpg', delete=True) as tmp:
image.save(tmp.name)
with exiftool.ExifTool() as et:
metadata = et.get_metadata(tmp.name)
return metadata |