开发者

Python: Getting image dimensions from URL

I'm working on a Python app (using the Django framework and running on Google Appengine). I'm trying to obtain the dimensions (width/height) of a remote image, from its url.

Is there any I can do this without having to download the image? I haven't found anything so开发者_Go百科 far...


There is no general way that you can know anything about an image until you retrieve (download) it. However, if the site you're downloading from has some standardized size in the URL (http://example.com/images/64x64/scary_clown.jpg), you might be able to use that -- assuming you trust them to enforce those sizes.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜