Added checks for unexisting thumbnail sources
This commit is contained in:
parent
e12308d3cc
commit
3051f37587
5 changed files with 15 additions and 0 deletions
|
@ -3,6 +3,9 @@ class FlashThumbnailGenerator implements IThumbnailGenerator
|
|||
{
|
||||
public function generateFromFile($srcPath, $dstPath, $width, $height)
|
||||
{
|
||||
if (!file_exists($srcPath))
|
||||
return false;
|
||||
|
||||
$tmpPath = tempnam(sys_get_temp_dir(), 'thumb') . '.png';
|
||||
|
||||
$cmd = sprintf(
|
||||
|
|
|
@ -3,6 +3,9 @@ class ImageGdThumbnailGenerator implements IThumbnailGenerator
|
|||
{
|
||||
public function generateFromFile($srcPath, $dstPath, $width, $height)
|
||||
{
|
||||
if (!file_exists($srcPath))
|
||||
return false;
|
||||
|
||||
$mime = mime_content_type($srcPath);
|
||||
|
||||
switch ($mime)
|
||||
|
|
|
@ -3,6 +3,9 @@ class ImageImagickThumbnailGenerator implements IThumbnailGenerator
|
|||
{
|
||||
public function generateFromFile($srcPath, $dstPath, $width, $height)
|
||||
{
|
||||
if (!file_exists($srcPath))
|
||||
return false;
|
||||
|
||||
$image = new Imagick($srcPath);
|
||||
$image = $image->coalesceImages();
|
||||
|
||||
|
|
|
@ -26,6 +26,9 @@ class SmartThumbnailGenerator implements IThumbnailGenerator
|
|||
|
||||
public function generateFromFile($srcPath, $dstPath, $width, $height)
|
||||
{
|
||||
if (!file_exists($srcPath))
|
||||
return false;
|
||||
|
||||
$mime = mime_content_type($srcPath);
|
||||
|
||||
switch ($mime)
|
||||
|
|
|
@ -3,6 +3,9 @@ class VideoThumbnailGenerator implements IThumbnailGenerator
|
|||
{
|
||||
public function generateFromFile($srcPath, $dstPath, $width, $height)
|
||||
{
|
||||
if (!file_exists($srcPath))
|
||||
return false;
|
||||
|
||||
$tmpPath = tempnam(sys_get_temp_dir(), 'thumb') . '.jpg';
|
||||
|
||||
$cmd = sprintf(
|
||||
|
|
Loading…
Reference in a new issue