I have tried many different types of this script and can not get it to work.
The Script is below. The first part of the script works, but the rest does not. See the comments where the script stops working. There are no error messages.
<?php
$image = "arnolds.jpg";
$size = @GetImageSize("http://www.gowestbend.com/images/$image");
if ($size[0] == 0) {
echo "No Image Available";
} else {
$width = 120; // Use whatever width you want here
$percent = ($width/$size[0]);
$temp = ($size[1]*$percent);
$newheight = sprintf("%d", $temp);
echo "Found the image.";
echo "<img src='http://www.gowestbend.com/images/$image' ='$width' height='$newheight'>";
// EVERYTHING WORKS UP TO THIS POINT
function resizejpg()
{
$src_img = imagecreatefromjpeg("http://www.gowestbend.com/images/$image");
$new_w = $width;
$new_h = $newheight;
$dst_img = imagecreate($new_w,$new_h);
imagecopyresized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,imagesx($src_img),imagesy($src_img));
imagejpeg($dst_img, "thumbs/$image");
echo "<img src='thumbs/$image' width='$width' height=width'$newheight'>";
}
}
?>
I do not get any error messages. Everything seems to work great besides the image is not saved to my server.
Please help me out.
Thanks!
-jfv