Problem with MagickEchoImageBlob and MagickWriteImage

MagickWand for PHP is an object-oriented PHP interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning MagickWand for PHP.
Post Reply
vinodkalpaka

Problem with MagickEchoImageBlob and MagickWriteImage

Post by vinodkalpaka »

Hi,

Please refer the code below.

<?php
$magick_wand=NewMagickWand();
MagickReadImage($magick_wand,'bag.jpg');

list($x_res, $y_res) = MagickGetImageResolution($magick_wand);
echo " x_res=$x_res - y_res=$y_res <br />";

$drawing_wand=NewDrawingWand();
DrawSetFont($drawing_wand,"arial.ttf");
DrawSetFontSize($drawing_wand,20);
DrawSetGravity($drawing_wand,MW_CenterGravity);
$pixel_wand=NewPixelWand();
PixelSetColor($pixel_wand,"white");
DrawSetFillColor($drawing_wand,$pixel_wand);

if (MagickAnnotateImage($magick_wand,$drawing_wand,0,0,0,"Rose") != 0)
{
MagickEchoImageBlob( $magick_wand );

}
else
{
echo MagickGetExceptionString($magick_wand);
}
?>


I am not getting the image in the browser.The same thing happening when I am using MagickWriteImage functions.
But I am receiving the output for the resolution.(MagickGetImageResolution($magick_wand))

The source image and Font files are in correct path (In the same folder).The CHMOD for the
folder is 777. Why do this happen? Please help me.

Thanking in advance.
From,
Vinod
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Problem with MagickEchoImageBlob and MagickWriteImage

Post by magick »

We have a patch for the problem you reported in ImageMagick 6.3.5-9 Beta. It is scheduled for release within a week.
vinodkalpaka

Re: Problem with MagickEchoImageBlob and MagickWriteImage

Post by vinodkalpaka »

Thank you for the quick reply.
Stickboy

Re: Problem with MagickEchoImageBlob and MagickWriteImage

Post by Stickboy »

I'm having similar sounding problems with the php_magickwand_dyn.dll extension - MagickEchoImageBlob producing no output, MagickGetImageWidth/Height producing nothing, MagickGetImageResolution producing garbage results etc. I have confirmed with Filemon that the server can read/write correctly to the temp folder defined by MAGICK_TMPDIR. Is this likely to be the same fault?

php_magickwand_q16_st.dll behaves perfectly in all regards, except for being horribly slow for what I'm trying to do. This is on Win2k3/IIS with ImageMagick 6.3.5 09/01/07 Q8.

Thanks
Cully
vinodkalpaka

Re: Problem with MagickEchoImageBlob and MagickWriteImage

Post by vinodkalpaka »

Yes, the magickwand seems to be very slow. How can I install magickwand in windows?
I have installed ImageMagick-6.3.5-Q16 in my program Files, then have placed the dlls' php_magickwand_dyn.dll and php_magickwand_q16_st.dll in my php extension folder (WAMP), then added the following lines to php.ini.
extension=php_magickwand_dyn.dll
extension=php_magickwand_q16_st.dll

Then I have restared the apache. It shows the dll error. Why did this happen? Please help me.
Stickboy

Re: Problem with MagickEchoImageBlob and MagickWriteImage

Post by Stickboy »

Yes, the magickwand seems to be very slow. How can I install magickwand in windows?
I have installed ImageMagick-6.3.5-Q16 in my program Files, then have placed the dlls' php_magickwand_dyn.dll and php_magickwand_q16_st.dll in my php extension folder (WAMP), then added the following lines to php.ini.
extension=php_magickwand_dyn.dll
extension=php_magickwand_q16_st.dll

Then I have restared the apache. It shows the dll error. Why did this happen? Please help me.
I believe you've made a mistake there: The _dyn.dll is a wrapper that requires the ImageMagick binaries to be installed and available on the system - calls to Magickwand using this extension pass through to those binaries. The q16_st.dll is a static library that contains the ImageMagick code itself, so does not require the binaries to be installed. You are supposed to choose one or the other, not both. Having both extensions enabled will produce a "MagickWand Already Loaded" dialog box when you restart.
vinodkalpaka

Re: Problem with MagickEchoImageBlob and MagickWriteImage

Post by vinodkalpaka »

I have uninstalled ImageMagick-6.3.5-Q16 from the program files. uncommented the line extension=php_magickwand_dyn.dll in php.dll.
Now the php.ini have the line extension=php_magickwand_q16_st.dll. But it shows the error message when I restart the server.
Some of the messages are as follows:
"The procedure entry point _zval_copy_ctor_func could not be located in the dynamic link library php5ts.dll"
"PHP Startup: Unable to load the dynamic lybrary 'c:/wamp/php/ext/php_magickwand_q16_st.dll
- The specified procedure could not be found.'"

The dll is in my extension folder and extension directory is shown as extension_dir = "c:/wamp/php/ext/" in my php.ini.
What is wrong with the installation ? Would you please help me?
Stickboy

Re: Problem with MagickEchoImageBlob and MagickWriteImage

Post by Stickboy »

Make sure you're using the dll from http://www.magickwand.org/download/php/ . There is an old version of the dll floating around the net that only works with older versions of PHP and causes entry point errors like this.
vinodkalpaka

Re: Problem with MagickEchoImageBlob and MagickWriteImage

Post by vinodkalpaka »

vinodkalpaka

Re: Problem with MagickEchoImageBlob and MagickWriteImage

Post by vinodkalpaka »

We have a patch for the problem you reported in ImageMagick 6.3.5-9 Beta. It is scheduled for release within a week.
what about the release of the patch for ImageMagick 6.3.5-9 Beta? Please help me.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Problem with MagickEchoImageBlob and MagickWriteImage

Post by magick »

ImageMagick 6.3.5-9 and MagickWand 1.0.5 was released a week ago. Download/install and see if the problem persists.
Stickboy

Re: Problem with MagickEchoImageBlob and MagickWriteImage

Post by Stickboy »

ImageMagick 6.3.5-9 and MagickWand 1.0.5 was released a week ago. Download/install and see if the problem persists.
No luck. I've installed 6.3.5-10 and the dynamic library (extension=php_magickwand_dyn.dll) still does not function correctly.

I haven't been able to test MagickWand 1.0.5 as there doesn't seem to be a Windows build available for download, and I can't find any instructions for building from source. Is there any ETA on the Windows dll's for 1.0.5 being available? And/Or is there any chance that a Q8 static dll can be made available to see if it will solve the horrendous speed issues I'm having with the Q16 version?

Thanks
Cully
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Problem with MagickEchoImageBlob and MagickWriteImage

Post by magick »

MagickWand for PHP prior to version 1.0.5 is incompatible with ImageMagick 6.2.* and above. Unfortunately we do not provide a Windows version of MagickWand for PHP. Perhaps a user will provide one. Anyone?
Stickboy

Re: Problem with MagickEchoImageBlob and MagickWriteImage

Post by Stickboy »

MagickWand for PHP prior to version 1.0.5 is incompatible with ImageMagick 6.2.* and above. Unfortunately we do not provide a Windows version of MagickWand for PHP. Perhaps a user will provide one. Anyone?
Bother. Do you not have any idea who provided these? :
http://www.magickwand.org/download/php/ ... php-5.2.0/
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Problem with MagickEchoImageBlob and MagickWriteImage

Post by magick »

No we have no trail of who provided the previous Windows version of MagickWand for PHP.
Post Reply