X-Git-Url: http://git.shiar.nl/minimedit.git/blobdiff_plain/af49d9b508825f62a0ea80c9069dd32d1147b433..d6bf8fa992cc01adc311b2ba80f29d7af466c2f3:/thumb/index.php diff --git a/thumb/index.php b/thumb/index.php index 24f46cc..aadbf4f 100644 --- a/thumb/index.php +++ b/thumb/index.php @@ -17,9 +17,9 @@ try { } catch (Throwable $e) { http_response_code($e->getCode() ?: 500); + header("X-Error: ".explode("\n", $e->getMessage())[0], FALSE); $target = '500.png'; if (file_exists($target)) { - header("X-Error: ".$e->getMessage()); header('Content-type: '.mime_content_type($target)); readfile($target); exit; @@ -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"