]> git.ipfire.org Git - ipfire.org.git/commitdiff
util: Be less aggressive when we generate thumbnails
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 4 Mar 2026 19:36:59 +0000 (19:36 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 4 Mar 2026 19:36:59 +0000 (19:36 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/backend/util.py

index baf6dcb312bdc1d44544b7634ea8e2938050aa86..2768ccabadbc4298fecbacbaf997540243b37481 100644 (file)
@@ -252,18 +252,19 @@ def generate_thumbnail(image, size, square=False, format=None, quality=None, **a
 
        # Arguments to optimise the compression
        args.update({
-               "subsampling" : "4:2:0",
-               "quality"     : quality or 72,
+               "subsampling" : "4:2:2",
+               "quality"     : quality or 80,
        })
 
-       if image.format == "JPEG":
+       if format == "JPEG":
                args.update({
-                       "qtables" : "web_low",
+                       "qtables" : "web_high",
                })
 
-       elif image.format == "WEBP":
+       elif format == "WEBP":
                args.update({
                        "lossless" : False,
+                       "method"   : 4,
                })
 
        with io.BytesIO() as f: