When a Notice or Warning occurs, the image fails. However, I am unable to catch the notice or warning.
<?php
$image = new Imagick($resource);
try {
$image->setImageCompressionQuality("Should be a Number Here not String");
}
catch ( ImagickException $e ) {
echo "This is a catch"; // should catch here but nope!
}
?>
The code above should catch because of the string passed when should be INT. The image fails but catch does not execute. I still get this message:
Notice: Use of undefined constant Should be a Number Here not String - assumed 'd' in /var/www/class.php on line 15 Warning: Imagick::setimagecompressionquality() expects parameter 1 to be long, string given in /var/www/class.php on line 15
I also tried ( Exception $e )