Hi,
I got an error on my local Xamp (PHP: 5.2.5) installation in windows when I try: $draw->setFillPatternURL('#ice');
output:
Fatal error: Uncaught exception 'ImagickDrawException' in E:\xampp\htdocs\feest\helloworld.php:30 Stack trace: #0 E:\xampp\htdocs\feest\helloworld.php(30): ImagickDraw->setfillpatternurl('#ice') #1 {main} thrown in E:\xampp\htdocs\feest\helloworld.php on line 30
Any ideas?
Uncaught exception 'ImagickDrawException' setFillPatternURL
Re: Uncaught exception 'ImagickDrawException' setFillPatternURL
Can not help much without code sample.
Mikko Koppanen
My blog: http://valokuva.org
My blog: http://valokuva.org
Re: Uncaught exception 'ImagickDrawException' setFillPatternURL
Code: Select all
<?php
/* Create a new imagick object */
$im = new Imagick( 'peritomoreno.jpg' );
/* Create imagickdraw object */
$draw = new ImagickDraw();
/* Start a new pattern called "ice" */
$draw->pushPattern( 'ice' , 0 , 0 , 50 , 50 );
/* Composite the image on the pattern */
$draw->composite( Imagick::COMPOSITE_OVER, 0, 0, 50, 50, $im );
/* Close the pattern */
$draw->popPattern();
/* Use the pattern called "ice" as the fill */
$draw->setFillPatternURL( '#ice' );
/* Set font size to 52 */
$draw->setFontSize( 52 );
/* Annotate some text */
$draw->annotation( 5, 50, "Hello World!" );
/* Create a new canvas and white image */
$canvas = new Imagick();
$canvas->newImage( 310, 70, "white" );
/* Add black border around the resulting image */
$canvas->borderImage( 'black', 1, 1 );
/* Draw the ImagickDraw on to the canvas */
$canvas->drawImage( $draw );
/* Set the format to PNG */
$canvas->setImageFormat( 'png' );
/* Output the image */
header( "Content-Type: image/png" );
echo $canvas;
?>
Re: Uncaught exception 'ImagickDrawException' setFillPatternURL
Can you try putting:
instead of just $draw->setFillPatternURL( '#ice' );
What is the message on the exception?
Code: Select all
try {
$draw->setFillPatternURL( '#ice' );
} catch( Exception $e) {
echo $e->getMessage();
}
What is the message on the exception?
Mikko Koppanen
My blog: http://valokuva.org
My blog: http://valokuva.org
Re: Uncaught exception 'ImagickDrawException' setFillPatternURL
There is no message... The script works like that...was not supposed to work?
Thanks either way, it's very much appreciated. I've got ice!
Thanks either way, it's very much appreciated. I've got ice!