开发者

python PIL and Image scaling

I want to make sure an image that will be saved stays inside the border of my specific dimensions and scales down if any of its dimensions exceed these specific dimensions开发者_如何学JAVA.

I will be using a gallery for my website using django and the width and height of it is certain, If I use crop while saving an image to keep dimensions under control, it crops a part and as a result doesn't act as I wish.

How can this be achieved ?


You should really look at http://thumbnail.sorl.net/ (especially http://thumbnail.sorl.net/template.html#options), it will solve this and many other problems that you may encounter later.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜