Quote:
Originally Posted by CalibUser
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 [...]
|
AFAIK, you'll need to use BytesIO() to convert the image data returned by bk.readfile().
For example:
Code:
from PIL import Image
from io import BytesIO
def run(bk):
data = bk.readfile('cover.jpg')
img = Image.open(BytesIO(data))
(width, height) = img.size
print(width, height)