IMagick image conversion issue

IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
Post Reply
fuentez

IMagick image conversion issue

Post by fuentez »

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

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?
mkoppanen
Posts: 309
Joined: 2007-06-09T07:06:32-07:00

Re: IMagick image conversion issue

Post by mkoppanen »

Mikko Koppanen
My blog: http://valokuva.org
fuentez

Re: IMagick image conversion issue

Post by fuentez »

That is what I ran into as well - I could not reproduce the issue on another machine.

The main diff between the machines is 64bit vs i386; but I cannot say if that has anything to do with the issue.

Another diff is there a quite a bit more packages installed on the i386 machine, are there any packages that could influence IMagick (and not ImageMagick)?

Also, any tips as how to test this further are welcome...
Post Reply