Page 1 of 1

using imagemagick "The connection was reset"

Posted: 2012-09-22T07:43:19-07:00
by sahel
when i try use Imagick class ,mozilla shows "The connection was reset"
my configuration is--
1.windows 7 - 32 bit.
2.php 5.3.5
3.ImageMagick-6.6.4-Q16
4.php_imagick.dll vc6
5.apache 2.0.63 and 2.2.17 tried both
6.in phpinfo page imagick module enabled shows
but when i

//
$im = new imagick('doctest.pdf');
$im->setImageFormat("jpg");
header("Content-Type: image/jpeg");
echo $im;

//or
$im = new imagick('doctest.pdf');

am using above code the browser crashed.
and apache error log shows me
"[notice] Parent: child process exited with status 255 -- Restarting.
[notice] Apache/2.0.63 (Win32) PHP/5.3.5 configured -- resuming normal operations
[notice] Server built: Jan 17 2008 22:58:29
[notice] Parent: Created child process 2276
[notice] Child 2276: Child process is running
[notice] Child 2276: Acquired the start mutex.
[notice] Child 2276: Starting 250 worker threads."

:?
Please give me a solution that what to do.

Re: using imagemagick "The connection was reset"

Posted: 2012-09-22T08:43:03-07:00
by Bonzo
You might get more information on the error using:

Code: Select all

try
{
$im = new imagick('doctest.pdf');
$im->setImageFormat("jpg");
header("Content-Type: image/jpeg");
echo $im;
}

catch (Exception $e) {
    echo 'Caught exception: ',  $e->getMessage(), "\n";
}
Will imagick work on a file other than a pdf?

Re: using imagemagick "The connection was reset"

Posted: 2012-09-23T19:38:14-07:00
by anthony
The read can use ANY image format, not just PDF's.

IM actually doesn't work on PDF's. At least not directly.

It gets the "ghostscript" delegate program/library to convert PDF to either PPM's (multiple images, no alpha) or PNG (single images with alpha), and then reads that.

Re: using imagemagick "The connection was reset"

Posted: 2012-09-24T06:30:25-07:00
by sahel
hi anthony,
Thanks for reply...
i have installed ghost script,but how to work with it can u explain me or give a suitable link.
please asap :?

Re: using imagemagick "The connection was reset"

Posted: 2012-09-24T07:39:15-07:00
by Bonzo
Have you tried your original code again since installing?

A computer restart would not do any harm either; Imagemagick and pressumably Imagick should automaticaly find GS.

Re: using imagemagick "The connection was reset"

Posted: 2012-09-24T07:45:06-07:00
by sahel
yes ,
but the same problem arise including "'gs' is not recognized as an internal or external command, operable program or batch file." :shock:

Re: using imagemagick "The connection was reset"

Posted: 2012-09-25T05:35:48-07:00
by sahel
finally i solve the problem but
i just able to use exec() function but not Imagick() class.
"the conetion was reset". :o