Skip to content

Instantly share code, notes, and snippets.

@drewlesueur
Created November 6, 2009 23:25
Show Gist options
  • Save drewlesueur/228386 to your computer and use it in GitHub Desktop.
Save drewlesueur/228386 to your computer and use it in GitHub Desktop.
resize image
<?
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