okie i get this error:
The image “http://localhost/image2.php” cannot be displayed, because it contains errors.
for this code
<?php
$file = 'stupidcat.jpg';
header('Content-type: image/jpeg');
$image_info = getimagesize ($file);
if($image_info[2] == 1)
{
//Gif image
$src_img = imagecreatefromgif($file);
}
elseif($image_info[2] == 2)
{
//Jpeg image
$src_img = imagecreatefromjpeg($file);
}
elseif($image_info[2] == 3)
{
//PNG image
$src_img = imagecreatefrompng($file);
}
$dst_img = imagecreatetruecolor(100,100);
imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, 100, 100, $image_info[0], $image_info[1]);
imagejpeg($dst_img, $file . "-small.jpg", 75);
imagedestroy($dst_img);
imagedestroy($src_img);
?>
the image is created but the image isnt shown :S