From 3b6bbd30635e64f654ed6f4674bb7a79c9727910 Mon Sep 17 00:00:00 2001 From: jedi Date: Wed, 11 Dec 2019 23:12:00 +0100 Subject: [PATCH] improve the thumbnail hack --- public/thumbnail.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/public/thumbnail.php b/public/thumbnail.php index 58bc2dd..c9c3fd5 100644 --- a/public/thumbnail.php +++ b/public/thumbnail.php @@ -1,9 +1,11 @@ cropThumbnailImage($width, $height); $imagick->setImagePage(0, 0, 0, 0); if (file_put_contents($thumb, $imagick) === false) { - throw new Exception("Could not put contents."); + log_error("Could not put contents."); } - return true; + + header("Content-type: image/jpeg"); + echo $imagick; + exit; } else { - throw new Exception("No valid image provided with {$img}."); + log_error("No valid image provided with {$img}."); }