[Python] Get the list of ExifTags names of Pillow library

Background

-I want to extract the information (meta information such as shooting time, latitude and longitude, so-called ** Exif **) that the image has using Python's Pillow library. ・ When I was investigating how to use Pillow, many of the articles that hit the search were scripts that get the ** "id" ** (2 to 5 digit number) of Exif, but the ** "id" ** I couldn't find a script to get the name (what it means). ・ It may be because it is too basic, but a memo for myself

Procedures and results

1 You can get a list of ExifTags names with the following code. from PIL.ExifTags import TAGS print(TAGS) {11: 'ProcessingSoftware', 254: 'NewSubfileType', 255: 'SubfileType', 256: 'ImageWidth', 257: 'ImageLength', 258: 'BitsPerSample', ...

2 Above, TAGS is a dictionary (dict class), so it is possible to call the corresponding name with the get () method. Example: from PIL import Image im = Image.open('test.jpg') exif = im._getexif() for id, value in exif.items():    print(id, TAGS.get(id), value)

3 Screenshot (command prompt screen example) ・ Images taken with iPhone cmd_screenshot.PNG

Explanation of each metadata (reference)

・ "Exiv2-Metameta reference tables" (https://www.exiv2.org/tags.html) … It says Standard Exif Tags, but are there any tags other than Standard?

Recommended Posts

[Python] Get the list of ExifTags names of Pillow library
[python] Get the list of classes defined in the module
About the basics list of Python basics
Try to get the function list of Python> os package
Get the number of specific elements in a python list
Get the column list & data list of CASTable
[python] Get a list of instance variables
[Python] Get the character code of the file
Get the EDINET code list in Python
[Python] Get a list of folders only
Get the contents of git diff from python
[python] Check the elements of the list all, any
[Python] Sort the list of pathlib.Path in natural sort
[Python] Get / edit the scale label of the figure
Get the caller of a function in Python
Make a copy of the list in Python
[Python] Get the last updated date of the website
[Python] Get the day of the week (English & Japanese)
Get the update date of the Python memo file.
the zen of Python
Get the size of the image file on the web (Python3, no additional library required)
Python script to get a list of input examples for the AtCoder contest
How to get a list of files in the same directory with python
How to get the number of digits in Python
[Python] Get the official file path of the shortcut file (.lnk)
[Python] Get the text of the law from the e-GOV Law API
Get the return code of the Python script from bat
Get the size (number of elements) of UnionFind in Python
[Python] Outputs all combinations of elements in the list
Python: Get a list of methods for an object
[Maya Python] Crush the contents of the script 2 ~ list Notes
Get the operation status of JR West with Python
[Python] Get the number of views of all posted articles
Get the URL of the HTTP redirect destination in Python
[Introduction to Python] Basic usage of the library matplotlib
Get the value of a specific key in a list from the dictionary type in the list with Python
Towards the retirement of Python2
Summary of Python3 list operations
Recommendation of binpacking library of python
[Python] Etymology of python function names
About the ease of Python
[Python] Get the previous month
[Python] Copy of multidimensional list
About the features of Python
The Power of Pandas: Python
[Maya Python] Crush the contents of the script 3 ~ List unknown Plugins
Run the intellisense of your own python library with VScode.
Get a list of purchased DMM eBooks with Python + Selenium
Developed a library to get Kindle collection list in Python
How to get the last (last) value in a list in Python
Get index of nth largest / smallest value in list in Python
How to get a list of built-in exceptions in python
Get the number of occurrences for each element in the list
Get the index of each element of the confusion matrix in Python
Get index of nth largest / smallest value in list in Python
2015-11-26 python> Display the function list of the module> import math> dir (math)
Get the source of the page to load infinitely with python.
Get the value of a specific key up to the specified index in the dictionary list in Python
The story of Python and the story of NaN
Wrap (part of) the AtCoder Library in Cython for use in Python
Get the number of views of Qiita