Hello,
I have installed imagemagick and magickwand on my server. Phpinfo() shows that magickwand is installed -
The magickwand details are
MagickWand Extension Version 1.0.7
ImageMagick support enabled
ImageMagick version ImageMagick 6.4.8-10 2009-02-03 Q16 http://www.imagemagick.org
I am running a simple script that just reads the image from a folder and displays it back on the browser. But, when I run the script in the browser, only the url is printed on the page. On another script that I ran with some error handling. I got this error.
Warning: magickreadimage() [function.magickreadimage]: SAFE MODE Restriction in effect. The script whose uid is 500 is not allowed to access / owned by uid 0 in /var/www/vhosts/server/httpdocs/folder/pencil1.php on line 19
Fatal error: magickreadimage(): PHP cannot read /folder/pencil/1440.gif; possible php.ini restrictions in /var/www/vhosts/server/httpdocs/folder/pencil1.php on line 19
What is going wrong here. I have run the script successfully on my home computer(windows +apache).
Thanks,
Nishant
magickreadimage not working
Re: magickreadimage not working
Hello,
this is a restriction on the hosting environment and does not imply a bug in MagickWand for PHP. More information about PHP safe mode:
http://www.php.net/features.safe-mode
this is a restriction on the hosting environment and does not imply a bug in MagickWand for PHP. More information about PHP safe mode:
http://www.php.net/features.safe-mode
Mikko Koppanen
My blog: http://valokuva.org
My blog: http://valokuva.org
Re: magickreadimage not working
I removed the safe mode restriction in php. Now this script is displaying nothing on the page, no errors nothing.
This is the script
<?php
$r = NewMagickWand();
MagickReadImage($r,"2.jpg");
MagickOilPaintImage( $r, 3 );
header('Content-Type: image/jpeg');
MagickEchoImageBlob($r);
?>
____________________________________________________________________________________
Also I tried running this script
<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);
$resource = NewMagickWand();
$dwand = NewDrawingWand();
$pwand = NewPixelWand();
PixelSetColor($pwand, "red");
DrawSetFont($dwand, "cour.ttf");
DrawSetFontSize($dwand, 50);
DrawSetFillColor($dwand, $pwand);
if(MagickReadImage($resource, "2.jpg")) {
}else
{
echo MagickGetExceptionString($resource);
}
if( MagickAnnotateImage( $resource, $dwand, 50, 50, 0, "Flower" ) )
{
header( 'Content-Type: image/gif' );
MagickEchoImageBlob( $resource );
}
else
{
echo MagickGetExceptionString($resource);
}
?>
This script gives this error- no decode delegate for this image format `/var/www/vhosts/example.com/httpdocs/pencil/2.jpg' @ constitute.c/ReadImage/526Wand contains no images `MagickWand-2' @ magick-image.c/MagickAnnotateImage/635
Does anyone have any clue whats happening.
This is the script
<?php
$r = NewMagickWand();
MagickReadImage($r,"2.jpg");
MagickOilPaintImage( $r, 3 );
header('Content-Type: image/jpeg');
MagickEchoImageBlob($r);
?>
____________________________________________________________________________________
Also I tried running this script
<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);
$resource = NewMagickWand();
$dwand = NewDrawingWand();
$pwand = NewPixelWand();
PixelSetColor($pwand, "red");
DrawSetFont($dwand, "cour.ttf");
DrawSetFontSize($dwand, 50);
DrawSetFillColor($dwand, $pwand);
if(MagickReadImage($resource, "2.jpg")) {
}else
{
echo MagickGetExceptionString($resource);
}
if( MagickAnnotateImage( $resource, $dwand, 50, 50, 0, "Flower" ) )
{
header( 'Content-Type: image/gif' );
MagickEchoImageBlob( $resource );
}
else
{
echo MagickGetExceptionString($resource);
}
?>
This script gives this error- no decode delegate for this image format `/var/www/vhosts/example.com/httpdocs/pencil/2.jpg' @ constitute.c/ReadImage/526Wand contains no images `MagickWand-2' @ magick-image.c/MagickAnnotateImage/635
Does anyone have any clue whats happening.
Re: magickreadimage not working
Does your ImageMagick installation support JPEG? Type
- convert -list format
Re: magickreadimage not working
See the Delegate Libraries subsection of this page: http://magick.imagemagick.org/script/ad ... p#problems.