Obey TINYIB_THUMBNAIL when overlaying video_overlay.png

Closes #79
This commit is contained in:
Trevor Slocum 2018-10-19 00:07:40 -07:00
parent 0ea4227d50
commit e34c85bd9e
1 changed files with 9 additions and 1 deletions

View File

@ -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);
}
}