i using pillow fork of pil , keep receiving error oserror: cannot identify image file <_io.bytesio object @ 0x103a47468> when trying open image. using virtualenv python 3.4 , no installation of pil. i have tried find solution based on others encountering same problem, however, solutions did not work me. here code: from pil import image import io # portion part of test code byteimg = image.open("some/location/to/a/file/in/my/directories.png").tobytes() # non test code databytesio = io.bytesio(byteimg) image.open(databytesio) # <- error here the image exists in initial opening of file , gets converted bytes. appears work else can't figure out why fails me. edit: databytesio.seek(0) does not work solution (tried it) since i'm not saving image via stream, i'm instantiating bytesio data, therefore (if i'm thinking of correctly) seek should @ 0. (this solution author himself. have moved here.) solution: # portion part ...
Comments
Post a Comment