After uploading image I’m making one thumbnail image its work fine with PNG and jpg but when I upload gif image by default its get converted to PNG, how can I prevent this?
Here is my code
$img = Image::make(storage_path().'/app/public/images/'.$this->folderRoot.'/'.$this->imageName);
$img->resize($this->size, null, function ($constraint) {$constraint->aspectRatio();});
$img->save('storage/app/public/images/'.$this->folderRoot.$this->storeFolder.$this->resizedImageName,90);
experts put light on this.
2
Answers
Try to pass the second parameter "format" like:
Try calling
encode()
before yousave()
Or you try setting
mime