thumb: indicate 1 month caching of generated output
[minimedit.git] / thumb / index.php
index 27a194ee51584f5840c42eff880207e02e6a42da..aadbf4f91eb664d1abc0109ca477d5e4aa71559c 100644 (file)
@@ -28,6 +28,7 @@ catch (Throwable $e) {
        exit;
 }
 
+header('Cache-Control: max-age=2628000, immutable');
 header('Content-type: '.mime_content_type($target));
 readfile($target);
 exit;
@@ -89,6 +90,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"