php - Why am I getting this error -


the path of filename correct, reason i'm getting error below when run script .. phpinfo shows me imagick installed ...and downloaded ghostscript i'm not sure if detects .. did downloading computer .. there i'm missing ? i'm confused on how ghostscript work php

fatal error: uncaught exception 'imagickexception' message 'can not process empty imagick object' in c:\xampp\htdocs\tms\test_php.php:7 stack trace: #0 c:\xampp\htdocs\tms\test_php.php(7): imagick->setimageresolution(1250, 1250) #1 {main} thrown in c:\xampp\htdocs\tms\test_php.php on line 7

php code:

    //echo phpinfo();     $filename = dirname(__file__).'\_media\4055-beckman-lead-app\client\fpo.pdf';     echo $filename;     $im = new imagick( $filename, 0777);      $im->setimageresolution(1250,1250);     $im->setimagecolorspace(255);     $im->setcompression(imagick::compression_jpeg);     $im->setcompressionquality(100);     $im->setimageformat('jpeg');      $im->writeimage('thumb.jpg');     $im->clear();     $im->destroy(); 

it appears though constructor imagick class should have 1 parameter passed it, passing 2 ($filename, 0777).

replace

$im = new imagick( $filename, 0777);  

with

$im = new imagick($filename);  

http://www.php.net/manual/en/imagick.construct.php


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -