<?php
header("Content-type: image/png");
//原图
$filename='c://aa.jpg';
//缩放比例 新图/原图
$percent = '0.5';
list($width,$height) = getimagesize($filename);
$newwidth = $width * $percent;
$newheight = $height * $percent;
// Load
$thumb = imagecreatetruecolor($newwidth, $newheight);
$source = imagecreatefromjpeg($filename);
// Resize
imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
// Output
$picpath = "c:/a.jpg";
imagejpeg($thumb,$picpath);
?>