8
8
# read the image data using PIL
9
9
image = Image .open (imagename )
10
10
11
- #extract other metadata
12
- info_dict = {"Filename" :image .filename ,
13
- "Image Size" :image .size ,
14
- "Image Height" :image .height ,
15
- "Image Width" :image .width ,
16
- "Image Format" :image .format ,
17
- "Image Mode" :image .mode ,
18
- "Image is Animated" : getattr (image , "is_animated" , False ),
19
- "Frames in Image" :getattr (image , "n_frames" , 1 )
20
- }
11
+ # extract other basic metadata
12
+ info_dict = {
13
+ "Filename" : image .filename ,
14
+ "Image Size" : image .size ,
15
+ "Image Height" : image .height ,
16
+ "Image Width" : image .width ,
17
+ "Image Format" : image .format ,
18
+ "Image Mode" : image .mode ,
19
+ "Image is Animated" : getattr (image , "is_animated" , False ),
20
+ "Frames in Image" : getattr (image , "n_frames" , 1 )
21
+ }
22
+
21
23
for label ,value in info_dict .items ():
22
24
print (f"{ label :25} : { value } " )
23
25
33
35
if isinstance (data , bytes ):
34
36
data = data .decode ()
35
37
print (f"{ tag :25} : { data } " )
38
+
0 commit comments