Skip to content

Extracting camera params from EXIF and XMP. #225

Answered by bigcat88
alfieroddan asked this question in Q&A
Discussion options

You must be logged in to vote
examples % python3 pillow_dump_info.py

Look at example's code:

        exif = image.getexif()
        if exif:
            exif = exif._get_merged_dict()  # noqa
        for k, v in exif.items():
            if isinstance(v, bytes) and len(v) > 8:
                print(f"{TAGS[k]} : size {len(v)} bytes")
            else:
                print(TAGS[k], ":", v)

But as I know new Pillow versions has something better to get Exif info.
You can take a look at examples here: python-pillow/Pillow#5863

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@alfieroddan
Comment options

Answer selected by alfieroddan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants