NewDrawingWand not returning handle

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
sourabh

NewDrawingWand not returning handle

Post by sourabh »

Hi All,

I am new to ImageMagick.

I have used NewDrawingWand() function in my script but the problem is it sometimes returns a resource handle and sometimes it does not.

Is there any prerequisite to call this function ? I am more confused as the function works perfectly at times.

Can anybody help me?

Thanks in advance !!

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

Re: NewDrawingWand not returning handle

Post by magick »

NewDrawingWand() returns a fatal error if it runs out of memory otherwise it returns a handle to a drawing wand. In a rare case it will return a NULL drawing wand if and only if it cannot allocate a 8 byte pointer to the graphic context pointer. Unless you can provide a script where we can reproduce the problem we most likely will be unable to offer any additional help.
sourabh

Re: NewDrawingWand not returning handle

Post by sourabh »

HI ,

Thanks for your reply

here is my test script.

require_once '../!config.inc.php'; //

print function_exists("NewDrawingWand");

try{

$foo = NewDrawingWand();

}
catch(Exception $e)
{

print "error:" ;
var_dump($e) ;
}


var_dump($foo) ;

print "done";

die();

Some times I get a handle and I think I am failing to destruct the handle.So the next time it does not return a handle. Is there anything related to destruction of handles?

Thanks,

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

Re: NewDrawingWand not returning handle

Post by magick »

Unfortunately we cannot reproduce the problem. Each time we run your script it properly returns a DrawingWand resource. We're using ImageMagick 6.3.9-7 and MagickWand for PHP 1.0.7.
Post Reply