Page 1 of 1

Can MW_API_FUNC_FAIL_CHECK_WAND_ERROR caught?

Posted: 2014-08-14T01:51:06-07:00
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!