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,116
12년 전 조회 3,647
12년 전 조회 2,148
12년 전 조회 9,316
12년 전 조회 2,389
12년 전 조회 4,616
12년 전 조회 7,271
12년 전 조회 2,422
12년 전 조회 3,684
12년 전 조회 1,413
12년 전 조회 2,120
12년 전 조회 2,003
12년 전 조회 2,166
12년 전 조회 4,164
12년 전 조회 1,932
12년 전 조회 2,682
12년 전 조회 2,118
12년 전 조회 1,762
12년 전 조회 2,195
12년 전 조회 2,930
12년 전 조회 2,204
12년 전 조회 2,039
12년 전 조회 2,563
12년 전 조회 1.6만
12년 전 조회 1,844
12년 전 조회 1,609
12년 전 조회 3,466
12년 전 조회 9,692
12년 전 조회 2,016
12년 전 조회 1,957
12년 전 조회 2,396
12년 전 조회 1,875
12년 전 조회 2,059
12년 전 조회 4,319
12년 전 조회 2,233
12년 전 조회 2,901
12년 전 조회 1,883
12년 전 조회 2,069
12년 전 조회 3,774
12년 전 조회 1,610
12년 전 조회 2,095
12년 전 조회 2,419
12년 전 조회 2,860
12년 전 조회 2,962
12년 전 조회 3,403
12년 전 조회 1,866
12년 전 조회 1,921
12년 전 조회 5,282
12년 전 조회 2,333
12년 전 조회 2,528
12년 전 조회 6,333
12년 전 조회 4,051
12년 전 조회 3,005
12년 전 조회 2,154
12년 전 조회 4,337
12년 전 조회 3,341
12년 전 조회 3,023
12년 전 조회 2,689
12년 전 조회 2,374
12년 전 조회 2,396
12년 전 조회 2,132
12년 전 조회 3,200
12년 전 조회 2,529
12년 전 조회 2,227
12년 전 조회 3,289
12년 전 조회 2,471
12년 전 조회 3,069
12년 전 조회 4,277
12년 전 조회 2,028
12년 전 조회 3,026
12년 전 조회 1,877
12년 전 조회 2,356
12년 전 조회 2,991
12년 전 조회 2,608
12년 전 조회 5,417
12년 전 조회 3,538
12년 전 조회 3,721
12년 전 조회 2,089
12년 전 조회 9,401
12년 전 조회 4,222
13년 전 조회 2,274
13년 전 조회 2,144
13년 전 조회 3,573
13년 전 조회 6,259
13년 전 조회 4,280
13년 전 조회 2,189
13년 전 조회 1.4만
13년 전 조회 2,065
13년 전 조회 1,485
13년 전 조회 4,795
13년 전 조회 2,292
13년 전 조회 1만
13년 전 조회 1,664
13년 전 조회 2,055
13년 전 조회 4,127
13년 전 조회 1,750
13년 전 조회 2,640
13년 전 조회 4,627
13년 전 조회 1,948
13년 전 조회 1,830