protected function makeShuiyin($filename = '')
{
//获取上传图片和水印图的宽高
$img = ROOTPATH . '/web/images/wxnj.jpg';
list($img1x, $img1y) = getimagesize($img);
list($img2x, $img2y) = getimagesize($filename); //此处传入的为绝对路径地址
//将图片生成实例
$i = imagecreatefromstring(file_get_contents($img));
$s = imagecreatefromstring(file_get_contents($filename));
//图片合成
// imagecopymerge($i, $s, 188, 920, 0, 0, $img2x, $img2y, 100); //不方便调整大小所以使用imagecopyresampled
imagecopyresampled($i, $s, 188, 920, 0, 0, 180, 180, $img2x,$img2y);
header("Content-type:image/png");
echo imagepng($i);
}