From 6b954d38992415716ae235a7a3cf16b1552f01b5 Mon Sep 17 00:00:00 2001 From: Adrian SALAS Date: Fri, 6 Mar 2020 16:08:14 +0100 Subject: [PATCH] Image: Close a file stream when an image is written --- app/code/community/Pimgento/Api/Helper/Image.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/code/community/Pimgento/Api/Helper/Image.php b/app/code/community/Pimgento/Api/Helper/Image.php index b2d92e8..947f5c2 100644 --- a/app/code/community/Pimgento/Api/Helper/Image.php +++ b/app/code/community/Pimgento/Api/Helper/Image.php @@ -77,6 +77,9 @@ public function saveMediaFile($name, $binary) $ioAdapter->open(['path' => dirname($path)]); $ioAdapter->streamOpen(basename($path)); - return $ioAdapter->streamWrite($binary); + $steamWrite = $ioAdapter->streamWrite($binary); + $ioAdapter->close(); + + return $steamWrite; } }