When I execute this script, nothing displays on my browser. I'm trying
to verify my image is being reduced by 50% before I try to write it to
a file:
// The file
$filename = "/home/public_html/radar2.jpg";
$percent = 0.5;
// Content type
header('Content-type: image/jpeg');
// Get new dimensions
list($width, $height) = getimagesize($f ilename);
$new_width = $width * $percent;
$new_height = $height * $percent;
// Resample
$image_p = imagecreatetrue color($new_widt h, $new_height);
$image = imagecreatefrom jpeg($filename) ;
imagecopyresamp led($image_p, $image, 0, 0, 0, 0, $new_width,
$new_height, $width, $height);
// Output
imagejpeg($imag e_p, null, 100);
to verify my image is being reduced by 50% before I try to write it to
a file:
// The file
$filename = "/home/public_html/radar2.jpg";
$percent = 0.5;
// Content type
header('Content-type: image/jpeg');
// Get new dimensions
list($width, $height) = getimagesize($f ilename);
$new_width = $width * $percent;
$new_height = $height * $percent;
// Resample
$image_p = imagecreatetrue color($new_widt h, $new_height);
$image = imagecreatefrom jpeg($filename) ;
imagecopyresamp led($image_p, $image, 0, 0, 0, 0, $new_width,
$new_height, $width, $height);
// Output
imagejpeg($imag e_p, null, 100);
Comment