Laravel Intervention / Image make gif返回静态图像

this is the code that i use to get the image:

$img = \Image::make($ad['image_url']);
return $img->response();

it works, the only thing is that the image returned is static.

When opening the real image url in a tab, it's animated

is there a way to get the animated result?

I think intervention library doesn't support animated Gif you may try other libraries directly like imagik or gd as given below https://github.com/Intervention/image/issues/176

Send the mime type also in response()

$img = \Image::make($ad['image_url']);
return $img->response($img->mime());

response() method takes two parameter mimetype and quality in integer

Hope this helps.

Thank you all, I solved it using another answer here on stackoverflow

$remoteImage = "http://www.example.com/gifs/logo.gif";
$imginfo = getimagesize($remoteImage);
header("Content-type: {$imginfo['mime']}");
readfile($remoteImage);

this returns the correct format

this is the url to the other answer from robjmills

Show image using file_get_contents