+ image magick tools to img.py
This commit is contained in:
1 parent
e2c0935e9b
commit
5b6b09b66b
1 file changed
+8
-1
+8
-1
@@ -1,5 +1,7 @@
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
|
from subprocess import call
|
||||||
|
|
||||||
__author__ = 'Roman Timashev'
|
__author__ = 'Roman Timashev'
|
||||||
|
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
@@ -22,4 +24,9 @@ def override_extension(dest, ext=None):
|
|||||||
if ext is not None:
|
if ext is not None:
|
||||||
dest = os.path.splitext(dest)[0] + ext
|
dest = os.path.splitext(dest)[0] + ext
|
||||||
|
|
||||||
return dest
|
return dest
|
||||||
|
|
||||||
|
|
||||||
|
def image_magick_resize(input_file, output_file, size, quality=85):
|
||||||
|
s = '%dx%d' % size
|
||||||
|
call(['convert', input_file, '-resize', s, '-quality', str(quality), output_file])
|
||||||
Reference in new issue
Block a user