업로드 된 이미지에 워터 마크를 추가하려고합니다. '이미지 워터 마크가 작동하지 않습니다.
Warning: imagecreatefromjpeg(upload/##.jpg): failed to open stream: No such file or directory in
나는 몇 가지 변화 php.net에서 코드를 사용하고 있습니다 :
는// Load the stamp and the photo to apply the watermark to
$stamp = imagecreatefrompng('logo.png');
$im = imagecreatefromjpeg($image);
// Set the margins for the stamp and get the height/width of the stamp image
$marge_right = 10;
$marge_bottom = 10;
$sx = imagesx($stamp);
$sy = imagesy($stamp);
// Copy the stamp image onto our photo using the margin offsets and the photo
// width to calculate positioning of the stamp.
imagecopy($im, $stamp, imagesx($im) - $sx - $marge_right, imagesy($im) - $sy - $marge_bottom, 0, 0, imagesx($stamp), imagesy($stamp));
// Output and free memory
header('Content-type: image/png');
imagepng($im);
imagedestroy($im);
?>
로고가 저장되는 위치를 확인하십시오. file이있는 디렉토리와 같은 디렉토리에 있어야합니다. –