aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio <silvio@devlet.com.br>2011-07-13 15:01:28 -0300
committerSilvio <silvio@devlet.com.br>2011-07-13 15:01:28 -0300
commit93c4026ed234463e58ab610776202e2386fd601d (patch)
treeb8baebbac8afacc486084169f6c5001f55613c34
parentbf110b14b33e7f5d74abcacf346d5a0907ab24fd (diff)
downloadvideo-93c4026ed234463e58ab610776202e2386fd601d.tar.gz
video-93c4026ed234463e58ab610776202e2386fd601d.tar.bz2
Single if block check at generate_thumbnails()
-rw-r--r--transcoders/video_ffmpeg_php.inc7
1 files changed, 1 insertions, 6 deletions
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.