Unable to open images with Python's Image.open()
Posted
by ensnare
on Stack Overflow
See other posts from Stack Overflow
or by ensnare
Published on 2010-04-30T03:10:57Z
Indexed on
2010/04/30
3:17 UTC
Read the original article
Hit count: 219
My code reads:
import Image
def generateThumbnail(self, width, height):
"""
Generates thumbnails for an image
"""
im = Image.open(self._file)
When I call this function, I get an error:
? AttributeError: type object 'Image' has no attribute 'open'
However in the console:
import Image
im = Image.open('test.jpg')
I have no problem. Any ideas? Thanks!
© Stack Overflow or respective owner