Page 1 of 1

Imagick vs Imagemagick inconsistency

Posted: 2008-09-27T01:11:52-07:00
by fuentez
Hi all,

I posted this in the Imagick board but it seems to get a lot less action and this might well be a bug.

---------------------------------
I have a strange problem that's been keeping me up for days.. the setup is as follows:

A CentOS 5 64bit box
Linux Technostation 2.6.24-19-xen #1 SMP Sat Jul 12 00:15:59 UTC 2008 x86_64 x86_64 x86_64 GNU/Linux
CentOS release 5.2 (Final)

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 ghostscript installed
ghostscript.x86_64 8.15.2-9.3.el5 installed
ghostscript-devel.x86_64 8.15.2-9.3.el5 installed
ghostscript-fonts.noarch 5.50-13.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 with certain PDF documents, 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 (code below)

the origional pdf - if anyone cares to test
http://209.20.89.130/test/fluke.pdf

of the created files,
http://209.20.89.130/test/fluke.png is wrong (created by Imagick)

and
http://209.20.89.130/test/fluke2.png is right (created by exec('convert etc'))

- although it should be the same conversion right?

Code:

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');
Anyone got any tips?