diff --git a/utils/Sync/img.py b/utils/Sync/img.py index e4a1fb9d..0ea192f4 100644 --- a/utils/Sync/img.py +++ b/utils/Sync/img.py @@ -1,5 +1,7 @@ import os +from subprocess import call + __author__ = 'Roman Timashev' from PIL import Image @@ -22,4 +24,9 @@ def override_extension(dest, ext=None): if ext is not None: dest = os.path.splitext(dest)[0] + ext - return dest \ No newline at end of file + 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])