We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a747c1f + d9cb8b7 commit 33bad0fCopy full SHA for 33bad0f
ethical-hacking/image-metadata-extractor/image_metadata_extractor.py
@@ -8,6 +8,19 @@
8
# read the image data using PIL
9
image = Image.open(imagename)
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
+ }
21
+for label,value in info_dict.items():
22
+ print(f"{label:25}: {value}")
23
+
24
# extract EXIF data
25
exifdata = image.getexif()
26
@@ -19,4 +32,4 @@
32
# decode bytes
33
if isinstance(data, bytes):
34
data = data.decode()
- print(f"{tag:25}: {data}")
35
+ print(f"{tag:25}: {data}")
0 commit comments