This means that image 1 has a few more EXIF tags than image 0. You’ll see the following output: Image 0 contains 53 members:Īs you can see, while both Image objects have a lot of common members, image 1 contains a few more than image 0. For every image that contains EXIF data, we’ll use Image’s exif_version property to display the version of EXIF it’s using: for index, image in enumerate (images ) : if image. We’ll do this by checking each Image object’s has_exif property. Let’s perform our first operation on each photo: confirming that they actually contain EXIF data. Finally, it puts the Image objects into an array so that we can iterate over them, performing the same operations on each photo’s EXIF metadata. It reads the file’s data in binary format into a file object, which it then uses to instantiate an exif Image object. Palm_1_image = Image (palm_1_file ) with open ( "./images/palm tree 2.jpg", "rb" ) as palm_2_file : With open ( "./images/palm tree 1.jpg", "rb" ) as palm_1_file : To answer these questions, we’ll load the data from these photos’ files into exif Image objects and then use those objects to examine the EXIF metadata: from exif import Image
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |