Skip to content

Instantly share code, notes, and snippets.

@simofacc
Created February 24, 2016 09:20
Show Gist options
  • Save simofacc/a954b0dc80580afc2244 to your computer and use it in GitHub Desktop.
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
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