diff --git a/objects/functions.php b/objects/functions.php index e20f8e7a82..eda006ca7a 100644 --- a/objects/functions.php +++ b/objects/functions.php @@ -605,6 +605,9 @@ function getimgsize($file_src) { } function im_resize($file_src, $file_dest, $wd, $hd) { + if(empty($file_dest)){ + return false; + } if (!file_exists($file_src)){ error_log("im_resize: Source not found: {$file_src}"); return false; @@ -622,6 +625,10 @@ function im_resize($file_src, $file_dest, $wd, $hd) { $format = 'jpeg'; } $destformat = strtolower(substr($file_dest, -4)); + if(empty($destformat)){ + error_log("destformat not found {$file_dest}"); + $destformat = ".jpg"; + } $icfunc = "imagecreatefrom" . $format; if (!function_exists($icfunc)){ error_log("im_resize: Function does not exists: {$icfunc}"); @@ -670,7 +677,7 @@ function im_resize($file_src, $file_dest, $wd, $hd) { } imagecopyresampled($dest, $src, 0, 0, ($ws - $wc) / 2, ($hs - $hc) / 2, $wd, $hd, $wc, $hc); - + $saved = false; if (!isset($q)) $q = 100; if ($destformat == '.png') @@ -678,7 +685,7 @@ function im_resize($file_src, $file_dest, $wd, $hd) { if ($destformat == '.jpg') $saved = imagejpeg($dest, $file_dest, $q); if (!$saved) - my_error_log('saving failed'); + error_log('saving failed'); imagedestroy($dest); imagedestroy($src); diff --git a/objects/video.php b/objects/video.php index e3b4119aa1..71eb8f7eea 100644 --- a/objects/video.php +++ b/objects/video.php @@ -1231,6 +1231,13 @@ class Video { } } } + + if(!file_exists($source['path'])){ + if($type!="_thumbs.jpg"){ + return array('path'=>false, 'url'=>false); + } + } + //ObjectYPT::setCache($name, $source); return $source; } @@ -1277,6 +1284,9 @@ class Video { } else { $obj->thumbsJpg = "{$global['webSiteRootURL']}view/img/audio_wave.jpg"; } + if(empty($obj->thumbsJpg)){ + $obj->thumbsJpg = $obj->poster; + } //ObjectYPT::setCache($name, $obj); return $obj; } diff --git a/objects/youPHPTubeEncoder.json.php b/objects/youPHPTubeEncoder.json.php index 4a7c9adfbb..58cdd911c6 100644 --- a/objects/youPHPTubeEncoder.json.php +++ b/objects/youPHPTubeEncoder.json.php @@ -44,7 +44,7 @@ $video->setDuration($_POST['duration']); $video->setDescription($_POST['description']); $advancedCustom = YouPHPTubePlugin::getObjectDataIfEnabled("CustomizeAdvanced"); -if(empty($obj->makeVideosInactiveAfterEncode)){ +if(empty($advancedCustom->makeVideosInactiveAfterEncode)){ // set active $video->setStatus('a'); }else{ diff --git a/plugin/Gallery/style.css b/plugin/Gallery/style.css index 880c0ef51e..efdd7d74ec 100644 --- a/plugin/Gallery/style.css +++ b/plugin/Gallery/style.css @@ -45,15 +45,28 @@ h3.galleryTitle{ } .aspectRatio16_9 { + display: block; width: 100%; - height: 56.25%; /* 16:9 Aspect Ratio */ + height: 0; + padding-bottom: 56.25%; + overflow: hidden; background-image: url(../../view/img/video-placeholder.png); - background-size: cover; + background-size: cover; } .aspectRatio16_9 img{ text-indent:-9999px; - height: 82px; + width: 100%; + display: block; + margin-left: auto; + margin-right: auto; +} + +.thumbsGIF{ + text-indent:-9999px; + width: 100%; + margin-left: auto; + margin-right: auto; } .firstRow{ diff --git a/plugin/Gallery/view/modeGallery.php b/plugin/Gallery/view/modeGallery.php index 3942bc2f78..2d55ee6c21 100644 --- a/plugin/Gallery/view/modeGallery.php +++ b/plugin/Gallery/view/modeGallery.php @@ -97,6 +97,7 @@ $totalPages = ceil($total / $_POST['rowCount']);