Intervention / imagecache

Caching extension for the Intervention Image Class

Home Page:https://image.intervention.io/v2/usage/cache

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem with transparent images

billmn opened this issue · comments

I've some problem with imagecache using transparent images (in my case a PNG) ... I give you some example:

Without any method

Without cache:

$image = Image::open($path);
return Response::make($image, 200, ['Content-Type' => $image->mime]);

noparam_nocache

With cache:

$cached_img = Image::cache(function($image) use ($path)
{
    $image->open($path);
    return $image;
}, 10, true);

return Response::make($cached_img, 200, ['Content-Type' => $cached_img->mime]);

noparam_cache


With resize

Without cache:

$image = Image::open($path);
$image->resize(null, 70);

return Response::make($image, 200, ['Content-Type' => $image->mime]);

without_cache

With cache:

$cached_img = Image::cache(function($image) use ($path)
{
    $image->open($path);
    $image->resize(null, 70);
    return $image;
}, 10, true);

return Response::make($cached_img, 200, ['Content-Type' => $cached_img->mime]);

with_cache


Doesn't return mimetype

In my examples, the property $cached_img->mime returns NULL and not the mimetype

Thanks, this was a major bug. But it's fixed now. Please update intervention/image to the newest version and everything should work fine.

Ok tested, now works fine!

Thank you