K P S wrote: > I'm able to read a .jpg from a .zip archive, but can't seem to > manipulate it. If I do this: > > zip=zipfile.ZipFile(inURL,mode="r") > picture=zip.read("00.jpg") > > I get the image, but it is of "type" ZipFile.
string, more likely (zip is a ZipFile object, picture is a string of bytes). PIL expects a file name or a file object, so you need to use the StringIO adapter: picture = zip.read(name) # returns a string file = StringIO.StringIO(picture) # wrap string in file-like object image = Image.open(file) # create image object from file-like object </F> -- http://mail.python.org/mailman/listinfo/python-list