python - Difference of Image.rotate on PIL/Pillow 2.8.1 and 3.1.1 -
i having bad time image.rotate() on pil until decided check on terminal going on. did:
python 2, pillow (2.8.1)
from pil import image im = image.new('rgb', (800, 500)) im.size out = im.rotate(90) out.size output (as expected):
>> (800, 500) >> (500, 800) python 3, pillow (3.1.1)
from pil import image im = image.new('rgb', (800, 500)) im.size out = im.rotate(90) out.size output:
>> (800, 500) >> (800, 500) and think that's right way call rotate in pillow 3x. here's documentation function:
image.rotate() missing something?
it bug in pillow<=2.9.0, fixed in 3.0.0. if want image change size when rotated, need include expand argument, e.g. img.rotate(-90, expand=1). see this issue details.
Comments
Post a Comment