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!
It’s odd that you’re getting an exception about Image being a type object, not a module. Is ‘Image’ being assigned to elsewhere in your code?