From e34c85bd9e00e7b6df3414ce542eb9a49109566a Mon Sep 17 00:00:00 2001 From: Trevor Slocum Date: Fri, 19 Oct 2018 00:07:40 -0700 Subject: [PATCH] Obey TINYIB_THUMBNAIL when overlaying video_overlay.png Closes #79 --- inc/functions.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/inc/functions.php b/inc/functions.php index 5798295..034400f 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -537,7 +537,11 @@ function fastimagecopyresampled(&$dst_image, &$src_image, $dst_x, $dst_y, $src_x } function addVideoOverlay($thumb_location) { - if (file_exists('video_overlay.png')) { + if (!file_exists('video_overlay.png')) { + return; + } + + if (TINYIB_THUMBNAIL == 'gd') { if (substr($thumb_location, -4) == ".jpg") { $thumbnail = imagecreatefromjpeg($thumb_location); } else { @@ -563,6 +567,10 @@ function addVideoOverlay($thumb_location) { } else { imagepng($thumbnail, $thumb_location); } + } else { // imagemagick + $discard = ''; + $exit_status = 1; + exec("convert $thumb_location video_overlay.png -gravity center -composite -quality 75 $thumb_location", $discard, $exit_status); } }