Search code examples
laravelfile-uploadheic

Laravel upload .heic image


I have added Imagick library and tried to upload .heic image

$image = new \Imagick();
$image->readImage($request->image);

And always return this error

NoDecodeDelegateForThisImageFormat `HEIC' @ error/constitute.c/ReadImage/509

I tried a lot of solutions but nothing works.

phpinfo enter image description here


Solution

  • I solved the problem by adding this library then I make shell_exec(convert $path $newPath), Then Image::make($newPath)and finally upload the image after converted it from the serve.