Skip to content

Instantly share code, notes, and snippets.

@a1Gupta
Last active February 11, 2017 08:22
Show Gist options
  • Save a1Gupta/84b767e46879e39aa5830024673948e8 to your computer and use it in GitHub Desktop.
Save a1Gupta/84b767e46879e39aa5830024673948e8 to your computer and use it in GitHub Desktop.
# Identify blank/broken image
try:
file = cStringIO.StringIO(urllib.urlopen(user.profile_pic.url).read())
img = Image.open(file)
except:
print "broken image"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment