Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit33bad0f

Browse files
authored
Merge pull requestx4nth055#90 from pauljones0/patch-1
Update image_metadata_extractor.py
2 parentsa747c1f +d9cb8b7 commit33bad0f

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

‎ethical-hacking/image-metadata-extractor/image_metadata_extractor.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,19 @@
88
# read the image data using PIL
99
image=Image.open(imagename)
1010

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+
forlabel,valueininfo_dict.items():
22+
print(f"{label:25}:{value}")
23+
1124
# extract EXIF data
1225
exifdata=image.getexif()
1326

@@ -19,4 +32,4 @@
1932
# decode bytes
2033
ifisinstance(data,bytes):
2134
data=data.decode()
22-
print(f"{tag:25}:{data}")
35+
print(f"{tag:25}:{data}")

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp