How to save the output of PHP image processing -
i'm not sure whether or not function intend do, need create thumbnail of image in folder.
$filename = '../images/' . $new_name; header('content-type: image/jpeg'); list($width, $height) = getimagesize($filename); $new_width = $width / $height; $new_height = 250 / $new_width; $new_height = round($new_height); $image_p = imagecreatetruecolor(250, $new_height); $image_s = imagecreatefromjpeg($filename); imagecopyresampled($image_p, $image_s, 0, 0, 0, 0, 250, $new_height, $width, $height); imagejpeg($image_p, null, 100);
so need save final result folder, not overwrite original image. found function on http://php.net/, have no idea how save image.
imagejpeg($image_p, "path/to/dir/image.jpg", 100);
and all.
Comments
Post a Comment