+ def send_image(self, mimetype, args=[]):
+ if 'maxwidth' in args:
+ import subprocess
+ emit_header(mimetype)
+ sys.stdout.flush()
+ subprocess.check_call(['gm', 'convert', self._filename(),
+ '-scale', args['maxwidth'].value + ' >', '-'])
+ else:
+ self.send_raw(mimetype)
+