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,804
12년 전 조회 4,347
12년 전 조회 2,804
12년 전 조회 9,824
12년 전 조회 3,103
12년 전 조회 5,301
12년 전 조회 7,942
12년 전 조회 3,132
12년 전 조회 4,401
12년 전 조회 2,130
12년 전 조회 2,797
12년 전 조회 2,664
12년 전 조회 2,857
12년 전 조회 4,846
12년 전 조회 2,638
12년 전 조회 3,341
12년 전 조회 2,767
12년 전 조회 2,467
13년 전 조회 2,899
13년 전 조회 3,653
13년 전 조회 2,860
13년 전 조회 2,679
13년 전 조회 3,240
13년 전 조회 1.6만
13년 전 조회 2,500
13년 전 조회 2,294
13년 전 조회 4,115
13년 전 조회 1만
13년 전 조회 2,672
13년 전 조회 2,633
13년 전 조회 3,063
13년 전 조회 2,524
13년 전 조회 2,680
13년 전 조회 4,955
13년 전 조회 2,913
13년 전 조회 3,555
13년 전 조회 2,550
13년 전 조회 2,739
13년 전 조회 4,468
13년 전 조회 2,307
13년 전 조회 2,798
13년 전 조회 3,104
13년 전 조회 3,544
13년 전 조회 3,645
13년 전 조회 4,092
13년 전 조회 2,560
13년 전 조회 2,567
13년 전 조회 5,959
13년 전 조회 3,023
13년 전 조회 3,190
13년 전 조회 7,055
13년 전 조회 4,725
13년 전 조회 3,675
13년 전 조회 2,852
13년 전 조회 5,027
13년 전 조회 4,043
13년 전 조회 3,718
13년 전 조회 3,404
13년 전 조회 3,080
13년 전 조회 3,062
13년 전 조회 2,821
13년 전 조회 3,946
13년 전 조회 3,251
13년 전 조회 2,864
13년 전 조회 3,964
13년 전 조회 3,176
13년 전 조회 3,773
13년 전 조회 4,978
13년 전 조회 2,753
13년 전 조회 3,705
13년 전 조회 2,545
13년 전 조회 3,042
13년 전 조회 3,655
13년 전 조회 3,303
13년 전 조회 6,116
13년 전 조회 4,228
13년 전 조회 4,402
13년 전 조회 2,779
13년 전 조회 1만
13년 전 조회 4,920
13년 전 조회 2,983
13년 전 조회 2,865
13년 전 조회 4,254
13년 전 조회 6,990
13년 전 조회 4,980
13년 전 조회 2,896
13년 전 조회 1.5만
13년 전 조회 2,774
13년 전 조회 2,205
13년 전 조회 5,267
13년 전 조회 2,739
13년 전 조회 1.1만
13년 전 조회 2,392
13년 전 조회 2,578
13년 전 조회 4,827
13년 전 조회 2,429
13년 전 조회 3,344
13년 전 조회 5,265
13년 전 조회 2,633
13년 전 조회 2,533