Code: Select all
<?
header('Content-Type: image/gif');
system("convert -pointsize 72 -font Utopia-Italic \\
label:' - Font Test - ' gif:-");
?>
If you are using PHP MagickWand you can use...
Code: Select all
<?
// This is a test of the Raw MagickWand installation in PHP
// See http://www.ioncannon.net/php/61/php-imagemagick-magickwand-examples/
$image = NewMagickWand();
if( MagickReadImage( $image, 'image.png' ) ) {
header( 'Content-Type: image/jpeg' );
MagickSetImageFormat( $image, 'JPEG' );
MagickEchoImageBlob( $image );
} else {
echo "Error in MagickReadImage()";
echo MagickGetExceptionString($image);
}
?>
Code: Select all
<?
$handle = imagick_readimage( getcwd() . "/image.gif" ) ;
if ( imagick_iserror( $handle ) )
{
$reason = imagick_failedreason( $handle ) ;
$description = imagick_faileddescription( $handle ) ;
print "handle2 failed!<BR>\nReason: $reason<BR>\nDescription: $d
escription<BR>\n" ;
exit ;
}
$new_handle = imagick_getimagefromlist( $handle ) ;
header( "Content-type: " . imagick_getmimetype( $new_handle ) ) ;
print imagick_image2blob( $new_handle ) ;
?>
See also IM Examples, Feedback