Link to home
Start Free TrialLog in
Avatar of Pedro Chagas
Pedro ChagasFlag for Portugal

asked on

Imagick View the Output

Hi E's, The code in snippet code put a watermark in a image, the problem is I can't see the picture when I execute the script:
in practice:
File index.php contain the code in snippet code.
For I see the picture created by index.php script I create the file mostra.php with this contain
=====================
<img src="index.php" />
=====================
When I execute the file mostra.php, the browser don't show the picture, don't show anything.

What I do wrong?
What is the best way to see the result of index.php?

Regards, JC
<?php
/* Create Imagick object */
$im = new Imagick( 'imagem.jpg' );
/* Create a drawing object and set the font size */
$draw = new ImagickDraw();
$draw->setFontSize( 30 );    
/* Make the watermark semi-transparent */
$draw->setFillAlpha( 0.4 );
/* Set gravity to the center. More about gravity: 
http://www.imagemagick.org/Usage/annotating/#gravity */
$draw->setGravity( Imagick::GRAVITY_CENTER );
/* Write the text on the image
Position x0,y0 (Because gravity is set to center)
Rotation 45 degrees.
*/
$im->annotateImage( $draw, 0, 0, 45, "Copyright" );
/* Output */
header( "Content-Type: image/{$im->getImageFormat()}" );
echo $im;
?>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of karoldvl
karoldvl
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial