X Tutup
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@
# read the image data using PIL
image = Image.open(imagename)

#extract other metadata
info_dict={"Filename":image.filename,
"Image Size":image.size,
"Image Height":image.height,
"Image Width":image.width,
"Image Format":image.format,
"Image Mode":image.mode,
"Image is Animated": getattr(image, "is_animated", False),
"Frames in Image":getattr(image, "n_frames", 1)
}
for label,value in info_dict.items():
print(f"{label:25}: {value}")

# extract EXIF data
exifdata = image.getexif()

Expand All @@ -19,4 +32,4 @@
# decode bytes
if isinstance(data, bytes):
data = data.decode()
print(f"{tag:25}: {data}")
print(f"{tag:25}: {data}")
X Tutup