From 8dbdcd8a8e56bfb40b8f142891701828bfb4bd10 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 9 May 2016 09:15:23 +0530 Subject: [PATCH] ... --- src/calibre/utils/img.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/calibre/utils/img.py b/src/calibre/utils/img.py index 739f7cd225..0af8282444 100644 --- a/src/calibre/utils/img.py +++ b/src/calibre/utils/img.py @@ -411,6 +411,8 @@ if __name__ == '__main__': k = args.pop(0) if '=' in k: n, v = k.partition('=')[::2] + if v in ('True', 'False'): + v = True if v == 'True' else False try: v = int(v) except Exception: @@ -426,4 +428,4 @@ if __name__ == '__main__': outf = bn.rpartition('.')[0] + '.' + '-output' + bn.rpartition('.')[-1] img = func(img, **kw) with lopen(outf, 'wb') as f: - f.write(image_to_data(img)) + f.write(image_to_data(img, fmt=outf.rpartition('.')[-1]))