From 8c371a84be30abc9216b49dbbfdd9abb31d45b8e Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 7 Aug 2025 18:09:08 +0200 Subject: [PATCH] #7684 --- src/Graphics/Image.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/Graphics/Image.php b/src/Graphics/Image.php index d60c745..14fe7f0 100644 --- a/src/Graphics/Image.php +++ b/src/Graphics/Image.php @@ -7,7 +7,6 @@ use Cubist\Util\Animations\OAMAnimation; use Cubist\Util\Animations\ZipAnimation; use Cubist\Util\Files\Files; use Cubist\Util\Text; -use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Log; class Image @@ -40,12 +39,17 @@ class Image return self::$_imagesizeCache[$cacheKey]; } - $res = Cache::rememberForever($cacheKey, function () use ($ext, $path) { - return self::_getimagesize($path, $ext); - }); - if (!$res) { - Cache::forget($cacheKey); - } else { + if(function_exists('cache')) { + $res = cache()->rememberForever($cacheKey, function () use ($ext, $path) { + return self::_getimagesize($path, $ext); + }); + if (!$res) { + cache()->forget($cacheKey); + } else { + self::$_imagesizeCache[$cacheKey] = $res; + } + }else{ + $res= self::_getimagesize($path, $ext); self::$_imagesizeCache[$cacheKey] = $res; } return $res; -- 2.39.5