Return to Snippet

Revision: 32606
at September 30, 2010 03:36 by rave


Initial Code
function saveAndResize($filename, $name, $new_width, $new_height, $pathAndFilename){
	list($width, $height) = getimagesize($filename);
	
	$image_p = imagecreatetruecolor($new_width, $new_height);
	$image = imagecreatefromjpeg($filename);
	imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
	
	imagejpeg($image_p, $pathAndFilename);
	imagedestroy($image_p);
}

Initial URL

                                

Initial Description

                                

Initial Title
Get remote Image, resize and save it

Initial Tags
resize, image, download

Initial Language
PHP