From a1741ba31aa227066b5144420fce45cadd090cb9 Mon Sep 17 00:00:00 2001 From: Antoine Lamielle Date: Sun, 21 Aug 2016 13:37:38 +0200 Subject: [PATCH] add a new gm setting to allow progressive JPEG --- prosopopee/prosopopee.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/prosopopee/prosopopee.py b/prosopopee/prosopopee.py index 08f3fdb..15aed08 100644 --- a/prosopopee/prosopopee.py +++ b/prosopopee/prosopopee.py @@ -22,7 +22,8 @@ SETTINGS = { "quality": 75, "auto-orient": True, "strip": True, - "resize": None + "resize": None, + "progressive": True }, "ffmpeg": { "binary": "ffmpeg", @@ -138,10 +139,11 @@ class Image(object): "auto-orient": "-auto-orient" if options["auto-orient"] else "", "strip": "-strip" if options["strip"] else "", "quality": "-quality %s" % options["quality"] if "quality" in options else "-define jpeg:preserve-settings", - "resize": "-resize %s" % options["resize"] if options.get("resize", None) is not None else "" + "resize": "-resize %s" % options["resize"] if options.get("resize", None) is not None else "", + "progressive": "-interlace Line" if options.get("progressive", None) is True else "" } - command = "gm convert {source} {auto-orient} {strip} {quality} {resize} {target}".format(**gm_switches) + command = "gm convert {source} {auto-orient} {strip} {progressive} {quality} {resize} {target}".format(**gm_switches) warning("Generation", source) print(command)