Getting Camera model information of an image using Python
Question: I am working on python automation in which I have to collect the camera model
(canon, Nikon etc.) information of an image. I searched a lot but I am getting
only pixel resolution, size and other data of an image. Is there any API or
library in which we can find the camera related each and every information or
a particular API which gives camera model information.?


Answer: The Python [`EXIF`](https://github.com/ianare/exif-py) library can be used to
extract a lot of information from a JPG image, including the `Image Make` and
`Image Model`, for example:

    
    
    import EXIF
    
    with open(r"sample.jpg", 'rb') as f_jpg:
        tags = EXIF.process_file(f_jpg, details=True)
        print tags['Image Make']
        print tags['Image Model']
    

This could display something like:

    
    
    Panasonic
    DMC-TZ20
    

Note, I have not tested this with the latest version.

