When I tried to resize an image using imagemagick it generates a full black image. Below is my PHP code
$image = new \Imagick( 'test.jpg' );
$image->resizeImage( 90, 90, Imagick::FILTER_LANCZOS, 0, TRUE );
$image->writeImage( 'test_thumbnail.jpg' );
I have given full permission to test.jpg
I use imagick module version: 3.1.2 and imageMagick version: 6.7.7-10
Any suggestions?
Thanks
The problem is the blur value. 0 will result in a black image. The blur factor where > 1 is blurry, < 1 is sharp.
Try this:
$image = new \Imagick( 'test.jpg' );
$image->resizeImage( 90, 90, Imagick::FILTER_LANCZOS, 0.9, TRUE );
$image->writeImage( 'test_thumbnail.jpg' );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With