Can MW_API_FUNC_FAIL_CHECK_WAND_ERROR caught?

The MagickWand interface is a new high-level C API interface to ImageMagick core methods. We discourage the use of the core methods and encourage the use of this API instead. Post MagickWand questions, bug reports, and suggestions to this forum.
Post Reply
lsylsy2
Posts: 1
Joined: 2014-08-14T01:29:48-07:00
Authentication code: 6789

Can MW_API_FUNC_FAIL_CHECK_WAND_ERROR caught?

Post by lsylsy2 »

First, sorry for my poor English.
We're using the MagickWand PHP extension(V1.0.8), and when we try to load a broken image, in magickwand.c, in function magickreadimageblob() starting from line 7765:

Code: Select all

if( MagickReadImageBlob( magick_wand, (void *) blob, (size_t) blob_len ) == MagickTrue ) {
   ...normal...
}
else {
	/* C API cannot read the image(s) from the BLOB: output error, with reason */
	MW_API_FUNC_FAIL_CHECK_WAND_ERROR( magick_wand, MagickWand, "unable to read the supplied BLOB argument" );
}
The MW_API_FUNC_FAIL_CHECK_WAND_ERROR will eventually call zend_error( MW_E_ERROR, ...),which will cause a 500 Fatal error;
But we just want the MagickReadImageBlob() function to return false, and the error can be handled by things like MagickGetException().
For I don't check the forum often, if a copy of the solution can be sent to lsylsy2 at gmail dot com, I would appreciate it very much!
Post Reply