php 图像拼接
1 <?php 2 $bigphoto = "big.jpg"; 3 $footerphoto = "1.jpg"; 4 $biginfo = getimagesize($bigphoto); 5 $footerinfo = getimagesize($footerphoto); 6 7 $bigwidth = $biginfo[0]; 8 $bigheight = $biginfo[1]; 9 10 $footerwidth = $footerinfo[0]; 11 $footerheight= $footerinfo[1]; 12 13 $initwidth = max(array($bigwidth,$footerwidth)); 14 $initheight = max(array($bigheight,$footerheight))+ min(array($bigheight,$footerheight)); 15 16 header("Content-type: image/jpeg"); 17 $im = imagecreatetruecolor($initwidth,$initheight); 18 imagecopyresized($im,imagecreatefromjpeg($bigphoto),0, 0, 0, 0,$bigwidth,$bigheight,$bigwidth,$bigheight); 19 imagecopyresized($im,imagecreatefromjpeg($footerphoto),0,$bigheight, 0, 0,$footerwidth,$footerheight,$footerwidth,$footerheight); 20 imagejpeg($im); 21 ?>