You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 9, 2023. It is now read-only.
If I try to get the mime of the image within the cache function (code below) I get the following error:
"call_user_func_array() expects parameter 1 to be a valid callback, class 'Intervention\Image\ImageManager' does not have a method 'mime'"
// pass calls to image cache
$img = Image::cache(function($image) use ($imageUrl, $width, $height) {
$mime = $image->mime();
if (!empty($width) && !empty($height)) {
$image->make($imageUrl)->fit($width, $height)->encode();
} else {
$image->make($imageUrl)->encode();
}
},525600);
It works fine if I use Image:: within the function, but then I'm loading the image again which defeats the purpose of the cache.
I want to be able to detect the mimetype and change the encoding if it's (For example) a bmp or tiff, but leave all other images in the same type (eg png)
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
If I try to get the mime of the image within the cache function (code below) I get the following error:
"call_user_func_array() expects parameter 1 to be a valid callback, class 'Intervention\Image\ImageManager' does not have a method 'mime'"
It works fine if I use Image:: within the function, but then I'm loading the image again which defeats the purpose of the cache.
I want to be able to detect the mimetype and change the encoding if it's (For example) a bmp or tiff, but leave all other images in the same type (eg png)
The text was updated successfully, but these errors were encountered: