【发布时间】:2014-10-25 19:35:27
【问题描述】:
使用 PIL 确定图像的宽度和高度
在特定图像上(幸运的是只有这个 - 但它很麻烦)从 image.size 返回的宽度/高度是相反的。
图片:
http://storage.googleapis.com/cookila-533ebf752b9d1f7c1e8b4db3/IMG_0004.JPG
代码:
from PIL import Image
import urllib, cStringIO
file = cStringIO.StringIO(urllib.urlopen('http://storage.googleapis.com/cookila-533ebf752b9d1f7c1e8b4db3/IMG_0004.JPG').read())
im=Image.open(file)
print im.size
结果是 - (2592, 1936)
应该是相反的
【问题讨论】:
-
@mhawke - 在浏览器中打开图片并找出问题...
标签: python python-imaging-library