돌아온헌이

watermark 질문입니다. !!!!!!!!!!!!

<?
/*
program: makeimg.php
description: creates new image by merging source image
with watermark and outputs it to the browser
*/

header("Content-Type: image/jpeg");
//(because the script outputs picture)

if (isset($_GET['transparency'])) {
if ($_GET['transparency'] >= 0 && $_GET['transparency'] <= 100) {
$transparency = (int) $_GET['transparency'];
}
}
else $transparency = 100; // 워터마크 투명도 조절

//$transparency = (int) $_GET['transparency'];

//source photo
$source_photo = stripslashes($_GET['photo']);
$photo = imagecreatefromjpeg($source_photo);

//watermark
$watermark = imagecreatefrompng('img/watermark.png');
$watermark_width = imagesx($watermark);
$watermark_height = imagesy($watermark);

//location of the watermark on the source image
$size = getimagesize($source_photo);
$dest_x = ($size[0] - $watermark_width) / 2;
$dest_y = ($size[1] - $watermark_height) / 2;

//make the image (merge source image with watermark)
imagecopymerge($photo, $watermark, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height, $transparency);

//output the image
imagejpeg($photo);

//free memory
imagedestroy($photo);
imagedestroy($watermark);
?>

위코드에서
$watermark = imagecreatefrompng('img/watermark.png');

마크할 이미지 경로가 내부가 아닌 외부로경로 할경우 경로를 어떻게 구성 해야 할까요?
|

댓글 6개

대답 없는 너~~~~~~~ 곡이 생각 납니다. ㅎㅎ

내부에서는 아주 잘됩니다.
http://www.php.net/manual/en/function.fopen.php
감사합니다. 꾸벅~
적용 안됨 머리 글적글적
이해력 부족.... 외부경로?
img/watermark.png 형식이 아닌

http://도메인/img/watermark.png
url에watermark. png를 끌어오려고합니다.

ㅎㅎ 보기엔 간단해보이는데 적용하면 안되네요
댓글을 작성하시려면 로그인이 필요합니다. 로그인

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
13년 전 조회 3,465
13년 전 조회 1,035
13년 전 조회 1,410
13년 전 조회 1,551
13년 전 조회 1.1만
13년 전 조회 1,998
13년 전 조회 983
13년 전 조회 1,537
13년 전 조회 972
13년 전 조회 1,546
13년 전 조회 1,396
13년 전 조회 1,160
13년 전 조회 1,536
13년 전 조회 1,540
13년 전 조회 1,164
13년 전 조회 1,540
13년 전 조회 1,011
13년 전 조회 1,058
13년 전 조회 1,551
13년 전 조회 1,027
🐛 버그신고