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,047
12년 전 조회 3,567
12년 전 조회 2,064
12년 전 조회 9,312
12년 전 조회 2,305
12년 전 조회 4,534
12년 전 조회 7,186
12년 전 조회 2,344
12년 전 조회 3,607
12년 전 조회 1,339
12년 전 조회 2,041
12년 전 조회 1,923
12년 전 조회 2,095
12년 전 조회 4,082
12년 전 조회 1,851
12년 전 조회 2,593
12년 전 조회 2,045
12년 전 조회 1,683
12년 전 조회 2,112
12년 전 조회 2,850
12년 전 조회 2,130
12년 전 조회 1,970
12년 전 조회 2,490
12년 전 조회 1.5만
12년 전 조회 1,755
12년 전 조회 1,534
12년 전 조회 3,385
12년 전 조회 9,617
12년 전 조회 1,930
12년 전 조회 1,882
12년 전 조회 2,318
12년 전 조회 1,806
12년 전 조회 1,984
12년 전 조회 4,245
12년 전 조회 2,153
12년 전 조회 2,820
12년 전 조회 1,813
12년 전 조회 1,992
12년 전 조회 3,698
12년 전 조회 1,533
12년 전 조회 2,025
12년 전 조회 2,347
12년 전 조회 2,782
12년 전 조회 2,887
12년 전 조회 3,329
12년 전 조회 1,790
12년 전 조회 1,841
12년 전 조회 5,207
12년 전 조회 2,266
12년 전 조회 2,446
12년 전 조회 6,271
12년 전 조회 3,966
12년 전 조회 2,935
12년 전 조회 2,081
12년 전 조회 4,253
12년 전 조회 3,264
12년 전 조회 2,943
12년 전 조회 2,615
12년 전 조회 2,297
12년 전 조회 2,317
12년 전 조회 2,052
12년 전 조회 3,129
12년 전 조회 2,446
12년 전 조회 2,151
12년 전 조회 3,214
12년 전 조회 2,398
12년 전 조회 2,987
12년 전 조회 4,206
12년 전 조회 1,962
12년 전 조회 2,941
12년 전 조회 1,801
12년 전 조회 2,282
12년 전 조회 2,924
12년 전 조회 2,533
12년 전 조회 5,339
12년 전 조회 3,456
12년 전 조회 3,647
12년 전 조회 2,012
12년 전 조회 9,335
12년 전 조회 4,148
12년 전 조회 2,207
12년 전 조회 2,075
12년 전 조회 3,508
12년 전 조회 6,193
12년 전 조회 4,212
12년 전 조회 2,120
12년 전 조회 1.4만
12년 전 조회 1,995
12년 전 조회 1,422
12년 전 조회 4,790
12년 전 조회 2,270
13년 전 조회 1만
13년 전 조회 1,598
13년 전 조회 2,038
13년 전 조회 4,044
13년 전 조회 1,679
13년 전 조회 2,578
13년 전 조회 4,566
13년 전 조회 1,874
13년 전 조회 1,764