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,410
12년 전 조회 3,922
12년 전 조회 2,430
12년 전 조회 9,591
12년 전 조회 2,689
12년 전 조회 4,919
12년 전 조회 7,519
12년 전 조회 2,701
12년 전 조회 3,999
12년 전 조회 1,698
12년 전 조회 2,391
12년 전 조회 2,267
12년 전 조회 2,444
12년 전 조회 4,453
12년 전 조회 2,229
12년 전 조회 2,967
12년 전 조회 2,380
12년 전 조회 2,048
12년 전 조회 2,489
12년 전 조회 3,207
12년 전 조회 2,476
12년 전 조회 2,288
12년 전 조회 2,812
12년 전 조회 1.6만
12년 전 조회 2,087
12년 전 조회 1,888
12년 전 조회 3,703
12년 전 조회 9,951
12년 전 조회 2,251
12년 전 조회 2,204
12년 전 조회 2,657
12년 전 조회 2,115
12년 전 조회 2,274
12년 전 조회 4,542
12년 전 조회 2,485
12년 전 조회 3,151
12년 전 조회 2,134
12년 전 조회 2,312
12년 전 조회 4,028
12년 전 조회 1,872
12년 전 조회 2,356
12년 전 조회 2,691
12년 전 조회 3,124
12년 전 조회 3,226
12년 전 조회 3,692
12년 전 조회 2,139
12년 전 조회 2,181
12년 전 조회 5,547
12년 전 조회 2,600
12년 전 조회 2,780
12년 전 조회 6,610
12년 전 조회 4,344
12년 전 조회 3,266
12년 전 조회 2,444
12년 전 조회 4,627
12년 전 조회 3,608
12년 전 조회 3,317
13년 전 조회 2,969
13년 전 조회 2,651
13년 전 조회 2,668
13년 전 조회 2,396
13년 전 조회 3,490
13년 전 조회 2,814
13년 전 조회 2,472
13년 전 조회 3,520
13년 전 조회 2,748
13년 전 조회 3,324
13년 전 조회 4,555
13년 전 조회 2,323
13년 전 조회 3,332
13년 전 조회 2,153
13년 전 조회 2,616
13년 전 조회 3,258
13년 전 조회 2,890
13년 전 조회 5,679
13년 전 조회 3,791
13년 전 조회 4,000
13년 전 조회 2,353
13년 전 조회 9,663
13년 전 조회 4,496
13년 전 조회 2,553
13년 전 조회 2,423
13년 전 조회 3,826
13년 전 조회 6,544
13년 전 조회 4,550
13년 전 조회 2,469
13년 전 조회 1.5만
13년 전 조회 2,344
13년 전 조회 1,763
13년 전 조회 5,051
13년 전 조회 2,539
13년 전 조회 1만
13년 전 조회 1,950
13년 전 조회 2,347
13년 전 조회 4,405
13년 전 조회 2,004
13년 전 조회 2,904
13년 전 조회 4,842
13년 전 조회 2,221
13년 전 조회 2,123