watermark 질문입니다. !!!!!!!!!!!! 정보
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');
마크할 이미지 경로가 내부가 아닌 외부로경로 할경우 경로를 어떻게 구성 해야 할까요?
/*
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');
마크할 이미지 경로가 내부가 아닌 외부로경로 할경우 경로를 어떻게 구성 해야 할까요?
댓글 전체

대답 없는 너~~~~~~~ 곡이 생각 납니다. ㅎㅎ
내부에서는 아주 잘됩니다.
내부에서는 아주 잘됩니다.

감사합니다. 꾸벅~

적용 안됨 머리 글적글적

이해력 부족.... 외부경로?

img/watermark.png 형식이 아닌
http://도메인/img/watermark.png
url에watermark. png를 끌어오려고합니다.
ㅎㅎ 보기엔 간단해보이는데 적용하면 안되네요
http://도메인/img/watermark.png
url에watermark. png를 끌어오려고합니다.
ㅎㅎ 보기엔 간단해보이는데 적용하면 안되네요