<?php
header ("Content-type: image/jpeg");
function resizeimg($image)
{
$image = $_GET['image'];
$w = 320;
$h = 240;
$x = @getimagesize($image);
$sw = $x[0];
$sh = $x[1];
$new = @ImageCreateFromJPEG ($image) or
$new = @ImageCreateFromPNG ($image) or
$new = @ImageCreateFromGIF ($image) or
$new = false;
if (!$new) {
readfile ($new);
} else {
$thumb = @ImageCreateTrueColor ($w, $h);
@ImageCopyResampled ($thumb, $new, 0, 0, 0, 0, $w, $h, $sw, $sh);
$newimage = @ImageJPEG ($thumb);
return $newimage;
}
}
?>
Ok, this script works but I'm trying to echo text to it and can't seem to get that to work. I'm wondering, is there something wrong with the way I used the variable with $_GET['image']; within the function? It seems to me that that could be a problem but I'm not sure how to address it.