Page 1 of 1

IMagick problem

Posted: 2013-04-01T07:40:15-07:00
by Fedver
Hi, i am really new about ImageMagick and IMagick, so please forgive my possibly noobish question.

I'm using Windows 8, WAMP 2.2 32 bit, PHP 5.4 and Apache 2.2.
I installed ImageMagick 6.8.4.2 Q16 dynamic 32 bit and downloaded imagick.dll from http://www.peewit.fr/imagick/ (PHP 5.4, thread safe version). I copied that .dll in the "ext" directory, updated php.ini and setted consistently the MAGICK_HOME environment in httpd.conf (C:\imagemagick\).
After I noticed phpinfo() shows IMagick 3.1.0 RC2 correctly installed (at least it seems), I tried a simply code as:

Code: Select all

$path = "c:\wamp\www\images\1.jpg";
	
try{
        $im = new Imagick(realpath($path));
        echo "OK";
}catch(Exception $e){
        echo $e->getMessage();
}
No exception.
So I tried that other code:

Code: Select all

$path = "c:\wamp\www\images\1.jpg";
	
try{
        $im = new Imagick();
		$im->pingImage(realpath($path));
        echo "OK";
}catch(Exception $e){
        echo $e->getMessage();
}
And I see:
no decode delegate for this image format `C:/Windows/TEMP/magick-5580Zi9qcMmgwwqa' @ error/constitute.c/ReadImage/550
It seems I missed the jpeg encoding (!!). Also che following:

Code: Select all

$path = "c:\wamp\www\images\1.jpg";
	
try{
        $im = new Imagick(realpath($path));
		$type=$im->getFormat();
        echo 'OK';
}catch(Exception $e){
        echo $e->getMessage();
}
Gave me an exception message:
Can not process empty Imagick object
Using the command: "convert -list configure" from the Windows' command prompt, I see this:
DELEGATES bzlib freetype jpeg jp2 lcms png tiff xl1 xml wmf zlib
Finally I noticed ImageMagick is working fine, but IMagick still not.


Any ideas on what could be the problem?
Thanks in advance to everyone will answer and forgive my rusty english.

Re: IMagick problem

Posted: 2013-04-01T07:53:16-07:00
by Bonzo
The first thing I would do is put everything in the one folder so that you do not need to worry about paths etc.

Try this:

Code: Select all

<?php 
$input = "1.jpg";
$im = new Imagick($input);  
$im->raiseImage( 10, 10, 200, 150, False ); 
$im->writeImage( "raiseImage.jpg" ); 
$im->destroy(); 
 ?> 
<img src="raiseImage.jpg">
Imagick is a bit of a minefield and I do not use it - I know this is not of much help!