do not fail completely if ppmquant step fails

pull/24/head
Hartmut Holzgraefe 2018-10-06 09:55:40 +02:00
rodzic 5b50e2d66c
commit 6e1d5f7508
1 zmienionych plików z 6 dodań i 3 usunięć

Wyświetl plik

@ -479,9 +479,12 @@ class JobRenderer(threading.Thread):
img.save(prefix + '.jpg', quality=50)
img.thumbnail((200, 200), Image.ANTIALIAS)
img.save(prefix + THUMBNAIL_SUFFIX)
pngquant_cmd = [ "pngquant", "--output", "%s.8bit.png" % prefix,
"%s.png" % prefix ]
subprocess.check_call(pngquant_cmd)
try:
pngquant_cmd = [ "pngquant", "--output", "%s.8bit.png" % prefix,
"%s.png" % prefix ]
subprocess.check_call(pngquant_cmd)
except Exception as e:
l.warning("PNG color reduction failed: %s" % e)
def run(self):
"""Renders the given job, encapsulating all processing errors and