开发者

how to create image thumbnails using django running on jython?

I need to create and save image 开发者_Python百科thumbnails in database. I am using django running on jython and mysql database. I was exploring python imaging library, but the i found out that i wont work with jython.

How do i create image thumbnails using jython and then save them in mysql db?? Any kind of help will be appreciated.


There are projects like sorl-thumbnail which is a great and easy to use django app for thumbnailing. But it also depends on PIL so you can't use it, that is bad news. Good news is since in jython you have access to all goods of java libs you can possibly use one of java code snippets available on the net, google: "java how to create thumbnails" (I didn't check any of them).

On the other side, in my project, I used ImageMagick's convert command-line tool (-resize or -thumbnail option). It gives very good quality thumbnails which are also optimized in terms of size if you use -strip with -resize or -thumnbail option alone (unnecessary info is stripped). The downside is that you need to operate on files and then fetch thumnbail back to mysql.

greetings,

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜