Page 1 of 1

NewDrawingWand not returning handle

Posted: 2008-03-14T07:13:39-07:00
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

Re: NewDrawingWand not returning handle

Posted: 2008-03-14T13:33:42-07:00
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.

Re: NewDrawingWand not returning handle

Posted: 2008-03-15T05:24:32-07:00
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

Re: NewDrawingWand not returning handle

Posted: 2008-03-15T07:01:21-07:00
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.