Question: ' ' ' Searching for Images with PIL Professor Hoffman April 2 0 2 4 ' ' ' import sys import os from PIL import

'''
Searching for Images with PIL
Professor Hoffman
April 2024
'''
import sys
import os
from PIL import Image
print("
Week 7 Starter Script
")
while True:
path = input("
FileName to Examine Q to Quit: ")
if path.lower()=='q':
break
if os.path.isfile(path):
ext = os.path.splitext(path)[1]
try:
with Image.open(path) as im:
print("File Details")
print("Extension: ", ext)
print("Image Format: ", im.format)
print("Image Width: ", im.width, "Pixels")
print("Image.Height: ", im.height, "Pixels")
print("Image.Mode: ", im.mode)
except Exception as err:
print("File is not a known Image Type: ", path)
else:
print("Path Provide is Not a File")
print("Script Done")
This week you will be generating a photo search script leveraging this weeks briefing, demonstration and sample scripts.
1) You will extract the photos.zip file provided. You will then process each file provided in the photos.zip extracted folder.
2) You will examine each file and determine if it is an image (using the PIL library) method, and extract and report the path, extension, format, width, height and mode of each image. These will be displayed in a PrettyTable. (SampleOutput is provided)
3) Your script will produce the following outputs:
You will submit 2 files.
Submit:
1) Your final script
2) Screenshot of your PrettyTable

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!