Sintaxa:
<?php
header("Content-type: image/jpeg");
function thumb_jpeg($image_name)
{
$destination_path= "thumb/";
list($width, $height) = getimagesize($image_name);
if ($height>$width) {
$new_height=75;
$new_width=$width*$new_height/$height;
} else {
$new_width=100;
$new_height=75;
}
$destimg=imagecreatetruecolor($new_width,$new_height) or die("Problem In Creating image");
$srcimg=ImageCreateFromJPEG($image_name) or die("Problem In opening Source Image");
imagecopyresampled($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or die("Problem In resizing");
ImageJPEG($destimg,$destination_path.$image_name) or die("Problem In saving");
};
?>
|