page: replace output caching by article object
[minimedit.git] / thumb / index.php
index 27a194ee51584f5840c42eff880207e02e6a42da..4549b44e6ab67385c52d6168da8b8b529ea16fe4 100644 (file)
@@ -1,6 +1,4 @@
 <?php
-ob_clean();
-
 list ($size, $imgpath) = explode('/', ltrim($Args, '/'), 2);
 $imgpath = preg_replace('{^(?=[0-9]+/)}', 'data/', $imgpath, 1);
 
@@ -28,6 +26,7 @@ catch (Throwable $e) {
        exit;
 }
 
+header('Cache-Control: max-age=2628000');
 header('Content-type: '.mime_content_type($target));
 readfile($target);
 exit;
@@ -89,6 +88,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"