ext = filename[filename.rfind("."):].lower()
// check to see if the file is an image and should be processed
if ext.endswith(validExts):
// construct the path to the image and yield it
imagePath = os.path.join(rootDir, filename).replace(" ", "\\ ")
yield imagePath
After Change
ext = filename[filename.rfind("."):].lower()
// check to see if the file is an image and should be processed
if validExts is None or ext.endswith(validExts):
// construct the path to the image and yield it
imagePath = os.path.join(rootDir, filename)
yield imagePath