Pdf thumbnail imagemagick php not working

I use imagemagick and ghostscript on my windows machine running under php5 in apache.

I tried

<?php
$im = new imagick('test.pdf[0]');
$im->setImageFormat( "jpg" );
header( "Content-Type: image/jpeg" );
echo $im;
?>

and found that it was not working.

Imagick works in my php info file ...

enter image description here

I am trying to create a sketch without saving it to the server hard drive ...

+3
source share
1 answer

You are displaying an OBJECT object, not the image you are dealing with. For output in .jpg format you will need to do

echo $im->getImageBlob();
+3
source

All Articles