hi all I have the code below, and I am getting this error:
The image "http://127.0.0.1/newsite/thumbnailgenerator.php" cannot be displayed because it contains errors. think this should be correct, what could the problem be? please help if you can. thanks :)
<?php
header('Content-type: image/jpg');
function create_thumb_nail($array_image)
{
if (isset($array_image['image'])){
$image = "images/".$array_image['image'];
$image_size = getimagesize($image);
$image_width = $image_size(0);
$image_height =$image_size(1);
$new_size = ($image_width + $image_height)/($image_width*($image_height/45));
$new_width - $image_width = $new_size;
$new_height = $image_height = $new_size;
$new_image = imagecreattruecolor($new_width, $new_height);
$old_image = imagecreatefromjepg($image);
imagecopyresized($new_image, $old_image, 0, 0, 0, 0, $new_width, $new_height, $image_width, $image_height);
iamgejpeg($new_image, $image.'.thumb.jpg');
}
}
$row = array("image"=>"space.jpg");
create_thumb_nail($row);
?>