开发者

imagemagick quality image issue using php

开发者 https://www.devze.com 2023-01-24 22:10 出处:网络
I have convert the PDF to image,I try using the exec,by excute 开发者_如何学Gothe linux command like \'/usr/bin/convert -density 300x300 file.pdf[0] -resample 160 -resize 512x700! images/sample-0.jpeg

I have convert the PDF to image,I try using the exec,by excute 开发者_如何学Gothe linux command like '/usr/bin/convert -density 300x300 file.pdf[0] -resample 160 -resize 512x700! images/sample-0.jpeg 2>&1'.But i have read some articles that it slow as compare to imagick php module.so try using php with code

  $uploadfile = "file.pdf";
$im = new Imagick ( $uploadfile . "[0]" );
$im->setImageFormat ( "png" );
$im->writeImage ( "p-10.png" );

As you can see that i am not setting the desity and resample,the quality of image is not good at all.In php manual also there no function that set the density,i also try with setResolution,but does not work.

Please help if any body any idea about this. have dream day

0

精彩评论

暂无评论...
验证码 换一张
取 消