Created
February 24, 2016 09:20
-
-
Save simofacc/a954b0dc80580afc2244 to your computer and use it in GitHub Desktop.
Check the resolution of images in a directory and output the incorrect image filenames
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Image | |
import os | |
files = [f for f in os.listdir('.') if os.path.isfile(f)] | |
for file in files: | |
if file.endswith(('.jpg')): | |
img = Image.open(os.path.join(os.curdir, file)) | |
size = img.size | |
if ((410, 300) != size): | |
name = file + ' ' | |
print name | |
else: | |
print file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment