From 93c4026ed234463e58ab610776202e2386fd601d Mon Sep 17 00:00:00 2001 From: Silvio Date: Wed, 13 Jul 2011 15:01:28 -0300 Subject: Single if block check at generate_thumbnails() --- transcoders/video_ffmpeg_php.inc | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'transcoders') diff --git a/transcoders/video_ffmpeg_php.inc b/transcoders/video_ffmpeg_php.inc index 5b0d8ba..2569616 100644 --- a/transcoders/video_ffmpeg_php.inc +++ b/transcoders/video_ffmpeg_php.inc @@ -61,12 +61,7 @@ class video_ffmpeg_php extends video_ffmpeg implements transcoder_interface { // Get the frame and create thumb file $frame = $movie->getFrame($framenumber); - if ($frame) { - $thumb = $frame->toGDImage(); - imagejpeg($thumb, drupal_realpath($thumbfile)); - } - - if (!file_exists(drupal_realpath($thumbfile))) { + if (!$frame || !imagejpeg($frame->toGDImage(), drupal_realpath($thumbfile))) { $error_param = array('%file' => $thumbfile); $error_msg = t("Error generating thumbnail for video: generated file %file does not exist.", $error_param); // Log the error message. -- cgit v1.2.3