thumb: flatten transparent images to white background
authorMischa POSLAWSKY <perl@shiar.org>
Fri, 12 Jul 2019 00:33:50 +0000 (02:33 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Fri, 12 Jul 2019 02:18:16 +0000 (04:18 +0200)
Ensure consistent background for some SVG and PNG originals.

thumb/index.php

index 27a194ee51584f5840c42eff880207e02e6a42da..f15a180b1e8e89983eea66d5430f7ee7fc19e159 100644 (file)
@@ -89,6 +89,7 @@ function mkthumb_exec($source, $target, $width, $height)
        $cmd = implode(' ', array_map('escapeshellarg', [
                'convert',
                '-trim',
+               '-background', 'white', '-layers', 'flatten',
                '-resize', "${width}x${height}",
                '-quality', '90%',
                $source, "jpg:$target"