<?
$image = "map.png";

$width = "100";
$height = "200";

$size = getimagesize($image);

$type = exif_imagetype($image);
$create = imagecreatefrompng($image);

$tmp_img = imagecreatetruecolor($width, $height);
imagecopyresized($tmp_img, $create, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);

imagedestroy($create);
$create = $tmp_img;

imagepng($create);
?>
Published in: PHP
Download

Related snippets