From 688ffc547e71a3df1908e7aa89757a55797fc872 Mon Sep 17 00:00:00 2001 From: AnthonyAxenov Date: Wed, 25 Sep 2024 08:12:11 +0800 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=20=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B2=D0=BE=D0=B9=20=D0=BF=D0=BE=D0=B4=D0=B3=D1=80=D1=83?= =?UTF-8?q?=D0=B7=D0=BA=D0=B8=20=D0=BB=D0=BE=D0=B3=D0=BE=D1=82=D0=B8=D0=BF?= =?UTF-8?q?=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/Controllers/PlaylistController.php | 2 +- src/app/Core/ChannelLogo.php | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/app/Controllers/PlaylistController.php b/src/app/Controllers/PlaylistController.php index a9a46f5..e2af52b 100644 --- a/src/app/Controllers/PlaylistController.php +++ b/src/app/Controllers/PlaylistController.php @@ -78,7 +78,7 @@ class PlaylistController extends Controller } $logo->store(); - $body = $logo->asBase64(); + $body = $logo->raw(); $size = $logo->size(); $mime = $logo->mimeType(); diff --git a/src/app/Core/ChannelLogo.php b/src/app/Core/ChannelLogo.php index b74f096..9933798 100644 --- a/src/app/Core/ChannelLogo.php +++ b/src/app/Core/ChannelLogo.php @@ -125,8 +125,17 @@ class ChannelLogo implements \Stringable return null; } - $mime = $this->mimeType(); - return "data:$mime;base64," . base64_encode($this->rawData); + return "data:$this->mimeType;base64," . base64_encode($this->rawData); + } + + /** + * Возвращает сырое изображение + * + * @return false|string|null + */ + public function raw(): false|string|null + { + return $this->rawData; } /**