Problem: It looks like the glob/PIL doesn't read images in subfolders. Is there a way to apply this to multiple directories/subfolders?
Purpose: List all the images in a directory, which has multiple folders (subfolders), by their name and size (resolution). I've used PIL/glob and so far, this has worked well on a single folder. However, when I try to apply the same logic on a folder that has over 1000 subfolders, the list returns no value.
Here is the code I've written using PIL, glob, and os:
from PIL import Image
import glob, os
im=[]
for infile in glob.glob("*.jpg"):
file, ext = os.path.splitext(infile)
im = Image.open(infile)
print(file, im.size)
The above code lists all the images in this format - e.g., NYC (3795, 1588).
I'd appreciate your suggestions. Thank you!