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

Commit353ed9b

Browse files
committed
update image metadata extractor tutorial
1 parent33bad0f commit353ed9b

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

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

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,18 @@
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-
}
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+
2123
forlabel,valueininfo_dict.items():
2224
print(f"{label:25}:{value}")
2325

@@ -33,3 +35,4 @@
3335
ifisinstance(data,bytes):
3436
data=data.decode()
3537
print(f"{tag:25}:{data}")
38+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp