Commit 31a965e4 authored by Trevor Slocum's avatar Trevor Slocum

Obey TINYIB_THUMBNAIL when overlaying video_overlay.png

Closes #79
parent 0ea4227d
...@@ -537,7 +537,11 @@ function fastimagecopyresampled(&$dst_image, &$src_image, $dst_x, $dst_y, $src_x ...@@ -537,7 +537,11 @@ function fastimagecopyresampled(&$dst_image, &$src_image, $dst_x, $dst_y, $src_x
} }
function addVideoOverlay($thumb_location) { 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") { if (substr($thumb_location, -4) == ".jpg") {
$thumbnail = imagecreatefromjpeg($thumb_location); $thumbnail = imagecreatefromjpeg($thumb_location);
} else { } else {
...@@ -563,6 +567,10 @@ function addVideoOverlay($thumb_location) { ...@@ -563,6 +567,10 @@ function addVideoOverlay($thumb_location) {
} else { } else {
imagepng($thumbnail, $thumb_location); imagepng($thumbnail, $thumb_location);
} }
} else { // imagemagick
$discard = '';
$exit_status = 1;
exec("convert $thumb_location video_overlay.png -gravity center -composite $thumb_location", $discard, $exit_status);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment