@@ -37,8 +37,9 @@ |
||
| 37 | 37 | |
| 38 | 38 | $renderedPictures = []; |
| 39 | 39 | |
| 40 | - if ($this->passFirst && sizeof($this->models) > 0) |
|
| 41 | - $this->models = array_slice($this->models, 1); |
|
| 40 | + if ($this->passFirst && sizeof($this->models) > 0) { |
|
| 41 | + $this->models = array_slice($this->models, 1); |
|
| 42 | + } |
|
| 42 | 43 | |
| 43 | 44 | $lightboxKey = $this->models[0]->field . '-' . $this->models[0]->object_id; |
| 44 | 45 | |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | |
| 53 | - $command = "{$this->ffmpegBin} -i {$this->videoSourceFilename} -ss 00:00:01.000 -vframes 1 {$this->outputImageFilename}"; |
|
| 53 | + $command = "{$this->ffmpegBin} -i {$this->videoSourceFilename} -ss 00:00:01.000 -vframes 1 {$this->outputImageFilename}"; |
|
| 54 | 54 | exec($command, $out, $result); |
| 55 | 55 | if (is_file($this->outputImageFilename)) { |
| 56 | 56 | return true; |
@@ -19,14 +19,17 @@ |
||
| 19 | 19 | { |
| 20 | 20 | $this->ffmpegBin = Yii::$app->getModule('files')->ffmpeg; |
| 21 | 21 | |
| 22 | - if (!file_exists($this->ffmpegBin)) |
|
| 23 | - throw new ErrorException("ffmpeg is not found: {$this->ffmpegBin}"); |
|
| 22 | + if (!file_exists($this->ffmpegBin)) { |
|
| 23 | + throw new ErrorException("ffmpeg is not found: {$this->ffmpegBin}"); |
|
| 24 | + } |
|
| 24 | 25 | |
| 25 | - if (!is_executable($this->ffmpegBin)) |
|
| 26 | - throw new ErrorException("ffmpeg is not executable: {$this->ffmpegBin}"); |
|
| 26 | + if (!is_executable($this->ffmpegBin)) { |
|
| 27 | + throw new ErrorException("ffmpeg is not executable: {$this->ffmpegBin}"); |
|
| 28 | + } |
|
| 27 | 29 | |
| 28 | - if (!is_file($videoSourceFilename)) |
|
| 29 | - throw new ErrorException('File not found on disk.'); |
|
| 30 | + if (!is_file($videoSourceFilename)) { |
|
| 31 | + throw new ErrorException('File not found on disk.'); |
|
| 32 | + } |
|
| 30 | 33 | |
| 31 | 34 | $this->videoSourceFilename = $videoSourceFilename; |
| 32 | 35 | $this->outputImageFilename = $outputImageFilename; |