Created
November 6, 2009 23:25
-
-
Save drewlesueur/228386 to your computer and use it in GitHub Desktop.
resize image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
public resize_image($image, $w, $h) { | |
$ret = imagecreatetruecolor($w, $h); //main image is called thumb. | |
imagealphablending( $ret, false ); | |
imagesavealpha( $ret, true ); | |
imagecopyresampled($ret, $image, 0, 0, 0, 0, $w, $h, imagesx($image), imagesy($image)); | |
//imageantialias($thumb,true); | |
return $ret; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment