View Single Post
Old 09-18-2015, 10:12 AM   #50
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,939
Karma: 6361444
Join Date: Nov 2009
Device: many
Quote:
Originally Posted by CalibUser View Post
One problem I had with the code for resizing the image was that I could not seem to read the image file using bk.readfile() into a buffer that PILow could process [I experimented with frombytes(), frombuffer() and fromarray()] so I resorted to saving the original image to disc and opening it again under PILow - not an ideal process.
Any file that does not have an application/xhtml+xml media type is read as pure binary by the launcher and returned that way. It will be a string of bytes.

At least, that is what it should do.

I will look at the launcher code to make sure that is really what is happening, just in case. I have no idea how data is passed to Pillow but if it wants a file you should be able to use StringIO with with bk.readfile() returns from an image.

I will look into this in case a fix is needed.

Thanks,

KevinH
KevinH is offline   Reply With Quote