php - Image creates correctly locally with imagemagick extension but not when deployed on server
one text
So I am creating image with ImageMagick
extension on laravel. And as long as I was developing locally everything looked fine images were created correctly.
But when I deployed projected on server my images doesn't create correctly. For Example this is locally:
Somehow it became black any suggestions maybe?
Code:
$image = new \Imagick();
// I apply two colors on image for example blue and yellow
$image->newImage($width, $height, $color);
// then I apply some custom image on that one of the colors
$customImage = new \Imagick(public_path('assets/example-photos/1.png'));
$customImage->resizeImage($width, $height, 0, 0);
$image->compositeImage($customImage, \Imagick::COMPOSITE_OVER, 0, 0);
$image->resetIterator();
$image->appendImages(true);
$image->setImageFormat('png');
// return it to frontend
return base64_encode($image->getImageBlob());
Source