Commit 05b2d82a authored by Romain Courteaud's avatar Romain Courteaud

Resize output image.

parent 00ae529b
......@@ -15,13 +15,13 @@ class ImageMagickTransforms:
def convert(self, orig, data, **kwargs):
parameter_list = ['convert']
parameter_list.append('-')
newwidth = kwargs.get('width','')
newheight = kwargs.get('height','')
if newwidth and newheight:
parameter_list.extend(['-resize', '%sx%s!' % (newwidth, newheight)])
elif newwidth or newheight:
parameter_list.extend(['-resize', '%sx%s' % (newwidth, newheight)])
parameter_list.append('-')
parameter_list.append('%s:-' % self.format)
process = subprocess.Popen(parameter_list,
stdin=subprocess.PIPE,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment