Фикс ленивой подгрузки логотипов

This commit is contained in:
2024-09-25 08:12:11 +08:00
parent ab23f8796e
commit 688ffc547e
2 changed files with 12 additions and 3 deletions

View File

@@ -78,7 +78,7 @@ class PlaylistController extends Controller
} }
$logo->store(); $logo->store();
$body = $logo->asBase64(); $body = $logo->raw();
$size = $logo->size(); $size = $logo->size();
$mime = $logo->mimeType(); $mime = $logo->mimeType();

View File

@@ -125,8 +125,17 @@ class ChannelLogo implements \Stringable
return null; return null;
} }
$mime = $this->mimeType(); return "data:$this->mimeType;base64," . base64_encode($this->rawData);
return "data:$mime;base64," . base64_encode($this->rawData); }
/**
* Возвращает сырое изображение
*
* @return false|string|null
*/
public function raw(): false|string|null
{
return $this->rawData;
} }
/** /**