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,786
12년 전 조회 4,333
12년 전 조회 2,788
12년 전 조회 9,814
12년 전 조회 3,087
12년 전 조회 5,288
12년 전 조회 7,933
12년 전 조회 3,110
12년 전 조회 4,382
12년 전 조회 2,109
12년 전 조회 2,784
12년 전 조회 2,647
12년 전 조회 2,847
12년 전 조회 4,827
12년 전 조회 2,620
12년 전 조회 3,326
12년 전 조회 2,753
12년 전 조회 2,449
12년 전 조회 2,883
13년 전 조회 3,639
13년 전 조회 2,840
13년 전 조회 2,666
13년 전 조회 3,221
13년 전 조회 1.6만
13년 전 조회 2,482
13년 전 조회 2,276
13년 전 조회 4,100
13년 전 조회 1만
13년 전 조회 2,659
13년 전 조회 2,611
13년 전 조회 3,051
13년 전 조회 2,510
13년 전 조회 2,663
13년 전 조회 4,940
13년 전 조회 2,889
13년 전 조회 3,544
13년 전 조회 2,528
13년 전 조회 2,714
13년 전 조회 4,443
13년 전 조회 2,279
13년 전 조회 2,778
13년 전 조회 3,086
13년 전 조회 3,522
13년 전 조회 3,625
13년 전 조회 4,080
13년 전 조회 2,536
13년 전 조회 2,551
13년 전 조회 5,938
13년 전 조회 2,994
13년 전 조회 3,160
13년 전 조회 7,035
13년 전 조회 4,708
13년 전 조회 3,658
13년 전 조회 2,838
13년 전 조회 5,013
13년 전 조회 4,027
13년 전 조회 3,699
13년 전 조회 3,386
13년 전 조회 3,054
13년 전 조회 3,037
13년 전 조회 2,801
13년 전 조회 3,922
13년 전 조회 3,232
13년 전 조회 2,850
13년 전 조회 3,942
13년 전 조회 3,147
13년 전 조회 3,746
13년 전 조회 4,962
13년 전 조회 2,731
13년 전 조회 3,689
13년 전 조회 2,528
13년 전 조회 3,021
13년 전 조회 3,627
13년 전 조회 3,280
13년 전 조회 6,093
13년 전 조회 4,197
13년 전 조회 4,379
13년 전 조회 2,759
13년 전 조회 1만
13년 전 조회 4,894
13년 전 조회 2,965
13년 전 조회 2,840
13년 전 조회 4,233
13년 전 조회 6,962
13년 전 조회 4,948
13년 전 조회 2,877
13년 전 조회 1.5만
13년 전 조회 2,760
13년 전 조회 2,187
13년 전 조회 5,264
13년 전 조회 2,732
13년 전 조회 1.1만
13년 전 조회 2,373
13년 전 조회 2,574
13년 전 조회 4,807
13년 전 조회 2,403
13년 전 조회 3,329
13년 전 조회 5,247
13년 전 조회 2,613
13년 전 조회 2,509