thumb: only shrink larger images
authorMischa POSLAWSKY <perl@shiar.org>
Sun, 27 Dec 2020 02:58:32 +0000 (03:58 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Wed, 30 Dec 2020 23:22:16 +0000 (00:22 +0100)
Support smaller user uploads unscaled (with smaller file sizes), expecting
browser upscaling if necessary (lower quality should not be a problem).

thumb/index.php

index 7de4f456939152bd931f61a15094b4a061ebbe08..bd08d8841497d266a1b573d172431f96981e2b0c 100644 (file)
@@ -99,7 +99,7 @@ function mkthumb_exec($source, $target, $width, $height)
                '-interlace', 'plane', # progressive
                '-strip', '-taint', # omit metadata
                '-sampling-factor', '4:2:0', '-colorspace', 'sRGB', # half chroma
-               '-resize', "${width}x${height}",
+               '-resize', "${width}x${height}>",
                '-quality', '85%',
                $source, "jpg:$target"
        ]));