I have a problem with resizing images with imagemagick
this is the info
ImageMagick module info
Array ( [versionNumber] => 1672 [versionString] => ImageMagick 6.8.8-7 Q16 x86_64 2015-01-27 http://www.imagemagick.org )
this is the imagemagick.php
<?php
$im = new Imagick();
$im->newPseudoImage(50, 50, "gradient:red-black");
$draw = new ImagickDraw();
$draw->pushPattern('gradient', 0, 0, 50, 50);
$draw->composite(Imagick::COMPOSITE_OVER, 0, 0, 50, 50, $im);
$draw->popPattern();
$draw->setFillPatternURL('#gradient');
$draw->setFontSize(52);
$draw->annotation(20, 50, "imagemagick");
$canvas = new Imagick();
$canvas->newImage(350, 70, "white");
$canvas->drawImage($draw);
$canvas->borderImage('black', 1, 1);
$canvas->setImageFormat('png');
header("Content-Type: image/png");
echo $canvas;
?>
this is the code i use to return the image
$query1=mysql_query("select image_path from user_uploads where id=".$p );
while($row=mysql_fetch_array($query1))
{
include('imagemagick.php');
$filename=$row['image_path'];
$final_image='/public_html/uploads/photos/'.$filename;
$im = new Imagick();
$im->readImage($final_image);
$im->thumbnailImage( 50, 50 );
$im->writeImage('/public_html/uploads/thumbs/'.$filename);
echo '<a class="show-all-audio" href="#show-all-audio' . $messageid . '" style="cursor:pointer" id="show_all_audio"><img src="http://www.rovespier.com/uploads/thumbs/'.$filename.'" class="small_icon" original-title="'.$message.'" ></a>';
}
all i get is an error page that says login.png cant be shown because it has errors on my login page http://www.rovespier.com/login.php