hi,
i am trying to capture jpeg file and output it using php but it is not working properly...could anybody tell me whats wrong with this code:
$imgname = "tronny.jpg";
$width = 135;
$size = getimagesize ($imgname);
$im = @imagecreatefromjpeg($imgname); / Attempt to open /
echo "<br>";
if (!$im) { / See if it failed /
echo "failed";
}
else {
$dest_width = $width;
$dest_height = ($width * $size[1]) / $size[0];
$dst_img = imagecreatetruecolor($dest_width,$dest_height);
$test = imagecopyresampled($dst_img, $im, 0, 0, 0, 0, $dest_width, $dest_height, $size[0], $size[1]);
$test2 = imagejpeg($dst_img);
imagedestroy($dst_img);
here's the output:
����JFIF gd-jpeg v1.0 (using IJG JPEG v62), default quality ����497?????....and a bunch of gibberish??#$%#%$#$%#@$
I checked the gd_info and i do have the gd_library installed ....i have no idea what is wrong with this.
thanks
Help is much appreciated
ko