Answer the question
In order to leave comments, you need to log in
How to change the Intervention Image format?
Hello. Installed the "Intervention Image" plugin. I just can’t figure out how to change the image format, let’s say an image in jpg format comes from the client, how can I change the image format in gif?
Here's what my code looks like:
$input = $request->all();
$image = $input['image'];
$filename = time() . '.' . $image->getClientOriginalExtension();
$path = public_path('img/' . $filename);
$img = Image::make($image);
$img->save($path);
$add = new Content();
$add->name = $input['name'];
$add->title = $input['name'];
$add->keywords = $input['keywords'];
$add->url = 'img/'.$filename;
$add->save();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question