how do i catch error in imagick
Posted: 2008-10-08T23:34:04-07:00
hello
just wondering how do i return/catch the error in imagick
function imagehere()
{
$im = new Imagick();
/* Create empty canvas */
$im->newImage( 100, 100, "white", "jpg" );//png,jpg,gif.. image format
/* Create the object used to draw */
$draw = new ImagickDraw();
/* Set the button color.
Changing this value changes the color of the button */
$draw->setFillColor( new ImagickPixel("#FFFFFF") ); // BOX COLOR //#4096EE
/* Create the rectangle */
$draw->rectangle( 0,0, 100, 100 );
/* assuming there is still codes here
in any case there is an error
*/
$draw->setFont( "Fonts/arial.tt" ); // This generate error
$draw->setFontSize( 15 );
/* the question is how do i catch the error that the font is missing since i want to return an error value */
}
just wondering how do i return/catch the error in imagick
function imagehere()
{
$im = new Imagick();
/* Create empty canvas */
$im->newImage( 100, 100, "white", "jpg" );//png,jpg,gif.. image format
/* Create the object used to draw */
$draw = new ImagickDraw();
/* Set the button color.
Changing this value changes the color of the button */
$draw->setFillColor( new ImagickPixel("#FFFFFF") ); // BOX COLOR //#4096EE
/* Create the rectangle */
$draw->rectangle( 0,0, 100, 100 );
/* assuming there is still codes here
in any case there is an error
*/
$draw->setFont( "Fonts/arial.tt" ); // This generate error
$draw->setFontSize( 15 );
/* the question is how do i catch the error that the font is missing since i want to return an error value */
}