Skip to content
Snippets Groups Projects

Use webp for images

Merged Cédric Krier requested to merge topic/default/webp into branch/default
+ 5
2
@@ -282,8 +282,11 @@
def dominant_color(path):
if app.debug:
return '#000'
color = ColorThief(
os.path.join(app.static_folder, path)).get_color(quality=1)
try:
color = ColorThief(
os.path.join(app.static_folder, path)).get_color(quality=1)
except Exception:
return '#000'
return '#%02x%02x%02x' % color
Loading