From 8b03686aef7f5e9f38445324d4a8ebbf2c0b93c8 Mon Sep 17 00:00:00 2001 From: qcjackman Date: Thu, 17 May 2018 11:12:58 +0800 Subject: [PATCH 1/2] fixed a bug when call Frame->save() when set is true --- src/FFMpeg/Media/Frame.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/FFMpeg/Media/Frame.php b/src/FFMpeg/Media/Frame.php index 590deff..0544113 100644 --- a/src/FFMpeg/Media/Frame.php +++ b/src/FFMpeg/Media/Frame.php @@ -115,7 +115,10 @@ class Frame extends AbstractMediaType $commands = array_merge($commands, $filter->apply($this)); } - $commands = array_merge($commands, array($pathfile)); + // without output filename when return binary string + if(!$returnBase64) { + $commands = array_merge($commands, array($pathfile)); + } try { if(!$returnBase64) { From 1711c66aad1c96ed504e4a8b43f3fec18494c9a3 Mon Sep 17 00:00:00 2001 From: qcjackman Date: Mon, 28 May 2018 14:00:32 +0800 Subject: [PATCH 2/2] fix the test expectations --- src/FFMpeg/Media/Frame.php | 3 +-- tests/Unit/Media/FrameTest.php | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/FFMpeg/Media/Frame.php b/src/FFMpeg/Media/Frame.php index 0544113..21499f9 100644 --- a/src/FFMpeg/Media/Frame.php +++ b/src/FFMpeg/Media/Frame.php @@ -115,8 +115,7 @@ class Frame extends AbstractMediaType $commands = array_merge($commands, $filter->apply($this)); } - // without output filename when return binary string - if(!$returnBase64) { + if (!$returnBase64) { $commands = array_merge($commands, array($pathfile)); } diff --git a/tests/Unit/Media/FrameTest.php b/tests/Unit/Media/FrameTest.php index 51ee2cd..4c96527 100644 --- a/tests/Unit/Media/FrameTest.php +++ b/tests/Unit/Media/FrameTest.php @@ -61,7 +61,9 @@ class FrameTest extends AbstractMediaTestCase $pathfile = '/target/destination'; - array_push($commands, $pathfile); + if (!$base64) { + array_push($commands, $pathfile); + } $driver->expects($this->once()) ->method('command')