thumb: jpeg encoding regardless of original
authorMischa POSLAWSKY <perl@shiar.org>
Thu, 23 Aug 2018 18:45:46 +0000 (20:45 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Sat, 25 Aug 2018 23:34:16 +0000 (01:34 +0200)
Disregard original file format after resizing, as it keeps lossless [png]
compression [size] and inconsistent results.

Unaltered request extension may not match, but should mostly display
correctly as browsers should prefer the correct content-type instead.

thumb/index.php

index 2a8e30303f7abf9482dca27e6f57e5cf9110aa5d..24f46ccb97ab44ea5125c48d63dc18a03283d4bd 100644 (file)
@@ -91,7 +91,7 @@ function mkthumb_exec($source, $target, $width, $height)
                '-trim',
                '-resize', "${width}x${height}",
                '-quality', '90%',
-               $source, $target
+               $source, "jpg:$target"
        ]));
        $return = shell_exec("$cmd 2>&1");
        if ($return) {