From 28bba097c37d47a1f48c779656a5446ad3651075 Mon Sep 17 00:00:00 2001 From: rr- Date: Sun, 1 Nov 2015 11:02:50 +0100 Subject: [PATCH] Added ffmpeg support in Flash thumbnails creation --- src/Services/ImageConverter.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Services/ImageConverter.php b/src/Services/ImageConverter.php index 242baeea..3c9ed261 100644 --- a/src/Services/ImageConverter.php +++ b/src/Services/ImageConverter.php @@ -82,6 +82,18 @@ class ImageConverter ]); } + if (!file_exists($targetPath) && ProgramExecutor::isProgramAvailable(self::PROGRAM_NAME_FFMPEG)) + { + ProgramExecutor::run( + self::PROGRAM_NAME_FFMPEG, + [ + '-i', + $sourcePath, + '-vframes', '1', + $targetPath, + ]); + } + if (!file_exists($targetPath)) throw new \Exception('Error while converting Flash file to image'); }