How to create image thumbnails using django running on jython?

I need to create and save image thumbnails in a database. I am using django running on the basis of jython and mysql. I studied the python image library, but I found out that I will not work with jython.

How to create thumbnails of images using jython and then save them in mysql db ?? Any help would be appreciated.

+4
source share
1 answer

There are projects like sorl-thumbnail, which is a great and easy-to-use django thumbnail application. But it also depends on PIL, so you cannot use it, this is bad news. The good news is, since in jython you have access to all java libs products, you can use one of the java code snippets available on the google: "java how to create sketches" (I have not tested them).

On the other hand, in my project, I used ImageMagick to convert the command line (option -resize or -thumbnail). It gives very high-quality thumbnails that are also optimized in terms of size if you use -strip with the -resize or -thumnbail option alone (unnecessary information is missing). The downside is that you need to work with files and then return thumnbail back to mysql.

Hi,

+2
source

Source: https://habr.com/ru/post/1308872/


All Articles