문제

I am trying to merge two images with image copy merge. This is the code I have:

<?php

$unframedPhoto = ('unframedPhoto.jpg');
$frame = ('frame.jpg');

imagecopymerge($frame, $unframedPhoto, 200, 200, 0, 0, 800, 800,0);

header('Content-Type: image/jpeg');
imagejpeg($frame, 'framedImage.jpg');

?>

That's the only code in my script. I am executing it by going to the .php file on my localhost, and I am getting no response. I do not see a new image 'framedImage.jpg' in my directory.

Any ideas what's going on here?

도움이 되었습니까?

해결책

Do like this...

<?php

$unframedPhoto= imagecreatefromjpeg('unframedPhoto.jpg');
$frame  = imagecreatefromjpeg('frame.jpg');
imagecopymerge($frame, $unframedPhoto, 200, 200, 0, 0, 800, 800,0);
header('Content-Type: image/jpeg');
imagejpeg($frame);
imagedestroy($frame);
imagedestroy($frame);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top