Hi all,
When I the result is not a picture but something that looks like the binary source! How do I get the actual jpg to print out??
I'm using this snippet:
$sizearray = @getimagesize($path);
/* figure out whether height or width is bigger */
if ($sizearray[0] < $sizearray[1]) {
$size = $sizearray[1];
} else {
$size = $sizearray[0];
}
/* figure out amount to reduce image */
if ($size>=60) {
$reduce = $maxsize/$size;
} else {
$reduce=$size;
}
$neww = round($sizearray[0]*$reduce,0);
$newh = round($sizearray[1]*$reduce,0);
$dst_img=ImageCreate($neww,$newh);
$src_img=ImageCreateFromJpeg($path);
ImageCopyResized($dst_img,$src_img,0,0,0,0,$neww,$newh,ImageSX($src_img),ImageSY($src_img));
ImageJpeg($dst_img);
ImageDestroy($dst_img);
ImageDestroy($src_img);
echo $dst_img; exit;
Thanks!
gary