IMagick image conversion issue
Posted: 2008-09-26T16:13:01-07:00
Hi all,
I have a strange problem that's been keeping me up for days.. the setup is as follows:
A CentOS 5 64bit box with ImageMagick installed
ImageMagick.x86_64 6.2.8.0-4.el5_1.1 installed
ImageMagick-devel.x86_64 6.2.8.0-4.el5_1.1 installed
And IMagick installed though 'pecl install imagick'
I have PDF documents that I want to make a PNG screenshot of after upload, so I have a script that does that. On this server, for some reason, the images do not come out right when ceated with Imagick.
If I run 'convert -colorspace RGB test.pdf[0] test.png' I get a perfect image; but when I run it through php I get a strange image with a recurring sloped dashed line. To test the problem I have created a local install of CentOS5 and all the same packages and tried to recreate the issue, but on this [note: i386] setup everything works fine. I can't seem to get my head around the problem, I need help at this point...
I created a php script that does the following to demonstrate the issue:
http://209.20.89.130/test/index.php
of the created files,
http://209.20.89.130/test/fluke.png is wrong
and
http://209.20.89.130/test/fluke2.png is right
- although it should be the same conversion
Anyone got any tips?
I have a strange problem that's been keeping me up for days.. the setup is as follows:
A CentOS 5 64bit box with ImageMagick installed
ImageMagick.x86_64 6.2.8.0-4.el5_1.1 installed
ImageMagick-devel.x86_64 6.2.8.0-4.el5_1.1 installed
And IMagick installed though 'pecl install imagick'
I have PDF documents that I want to make a PNG screenshot of after upload, so I have a script that does that. On this server, for some reason, the images do not come out right when ceated with Imagick.
If I run 'convert -colorspace RGB test.pdf[0] test.png' I get a perfect image; but when I run it through php I get a strange image with a recurring sloped dashed line. To test the problem I have created a local install of CentOS5 and all the same packages and tried to recreate the issue, but on this [note: i386] setup everything works fine. I can't seem to get my head around the problem, I need help at this point...
I created a php script that does the following to demonstrate the issue:
http://209.20.89.130/test/index.php
of the created files,
http://209.20.89.130/test/fluke.png is wrong
and
http://209.20.89.130/test/fluke2.png is right
- although it should be the same conversion
Code: Select all
<?php
$im = new Imagick();
echo '<pre>' .var_export($im->getVersion(), true) . '</pre>';
$im->readImage('fluke.pdf[0]');
$im->setImageFormat( "png");
$im->setImageColorSpace(1);
$im->writeImage('fluke.png');
exec('convert -colorspace RGB fluke.pdf[0] fluke2.png');