s

이미지에 워터마크 처리하기

<?php

//이미지 처리 함수 인클루드
include_once 'lib/image_proc.function.php';

$path_file = 'sample_image/test.jpg';//원본파일
$path_mark_file ='sample_image/php.png';//워터마크에 사용할 파일
$path_save_file = 'sample_image/watermak.jpg';//워터마크 처리한 것을 저장할 파일

//원본의 이미지 리소스를 받아온다.
list($src, $src_w, $src_h) = get_image_resource_from_file ($path_file);
if (empty($src)) die($GLOBALS['errormsg'] . "<br />\n");

//워터마크에 사용될 이미지 리소스를 받아온다.
list($mark, $mark_w, $mark_h) = get_image_resource_from_file ($path_mark_file);
if (empty($mark)) die($GLOBALS['errormsg'] . "<br />\n");

//원본의 왼쪽 꼭지점을 기준점으로 선명도 60으로 워터마크 처리
$result_watermark = imagecopymerge($src, $mark, 0, 0, 0, 0, $mark_w, $mark_h, 60);
if ($result_watermark === false) die("워터마크 처리에 실패하였습니다.<br />\n");

$result_save = save_image_from_resource ($src, $path_save_file);//저장
if ($result_save === false) die($GLOBALS['errormsg'] . "<br />\n");

@imagedestroy($mark);
@imagedestroy($src);

//성공하였다면 이미지 출력

?>
원본 이미지 <br />
<img src='<?=$path_file?>'> <br />

워터마크에 사용할 이미지 <br />
<img src='<?=$path_mark_file?>'> <br />

워터마크 처리한 이미지 <br />
<img src='<?=$path_save_file?>'> <br />



참고 : http://kr2.php.net/manual/kr/function.ceil.php
|

댓글 2개

유창화님 강의네요 ~~
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

+
제목 글쓴이 날짜 조회
12년 전 조회 2,064
12년 전 조회 3,588
12년 전 조회 2,092
12년 전 조회 9,313
12년 전 조회 2,330
12년 전 조회 4,560
12년 전 조회 7,208
12년 전 조회 2,371
12년 전 조회 3,629
12년 전 조회 1,361
12년 전 조회 2,063
12년 전 조회 1,946
12년 전 조회 2,114
12년 전 조회 4,109
12년 전 조회 1,874
12년 전 조회 2,625
12년 전 조회 2,067
12년 전 조회 1,705
12년 전 조회 2,141
12년 전 조회 2,866
12년 전 조회 2,153
12년 전 조회 1,992
12년 전 조회 2,518
12년 전 조회 1.5만
12년 전 조회 1,778
12년 전 조회 1,561
12년 전 조회 3,410
12년 전 조회 9,649
12년 전 조회 1,950
12년 전 조회 1,902
12년 전 조회 2,348
12년 전 조회 1,828
12년 전 조회 2,004
12년 전 조회 4,270
12년 전 조회 2,179
12년 전 조회 2,843
12년 전 조회 1,836
12년 전 조회 2,021
12년 전 조회 3,728
12년 전 조회 1,561
12년 전 조회 2,051
12년 전 조회 2,368
12년 전 조회 2,803
12년 전 조회 2,908
12년 전 조회 3,353
12년 전 조회 1,817
12년 전 조회 1,870
12년 전 조회 5,229
12년 전 조회 2,289
12년 전 조회 2,469
12년 전 조회 6,291
12년 전 조회 4,002
12년 전 조회 2,957
12년 전 조회 2,106
12년 전 조회 4,270
12년 전 조회 3,289
12년 전 조회 2,966
12년 전 조회 2,637
12년 전 조회 2,323
12년 전 조회 2,338
12년 전 조회 2,076
12년 전 조회 3,152
12년 전 조회 2,470
12년 전 조회 2,175
12년 전 조회 3,235
12년 전 조회 2,420
12년 전 조회 3,004
12년 전 조회 4,226
12년 전 조회 1,982
12년 전 조회 2,963
12년 전 조회 1,824
12년 전 조회 2,301
12년 전 조회 2,944
12년 전 조회 2,560
12년 전 조회 5,360
12년 전 조회 3,480
12년 전 조회 3,675
12년 전 조회 2,038
12년 전 조회 9,355
12년 전 조회 4,173
12년 전 조회 2,221
12년 전 조회 2,094
12년 전 조회 3,529
12년 전 조회 6,210
12년 전 조회 4,235
12년 전 조회 2,137
12년 전 조회 1.4만
13년 전 조회 2,013
13년 전 조회 1,441
13년 전 조회 4,794
13년 전 조회 2,280
13년 전 조회 1만
13년 전 조회 1,617
13년 전 조회 2,047
13년 전 조회 4,068
13년 전 조회 1,697
13년 전 조회 2,600
13년 전 조회 4,585
13년 전 조회 1,895
13년 전 조회 1,783