是否可以使用imagecopyresampled
函数而不是imagecopy
函数对图像产生水印效果?
我的研究没有基于好的例子,所以如果有人能回答我的问题,我会非常感激。
list($width, $height) = getimagesize($path);
$src = imagecreatefromjpeg($path);
$temp = imagecreatetruecolor($newwidth, $newheight);
imagecopyresampled($temp, $src, 0,0,0,0, $newwidth, $newheight, $width, $height);
imagejpeg($temp, $path,100);
imagedestroy($temp);