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,708
12년 전 조회 4,262
12년 전 조회 2,707
12년 전 조회 9,768
12년 전 조회 3,008
12년 전 조회 5,204
12년 전 조회 7,831
12년 전 조회 3,007
12년 전 조회 4,303
12년 전 조회 2,022
12년 전 조회 2,696
12년 전 조회 2,550
12년 전 조회 2,738
12년 전 조회 4,738
12년 전 조회 2,531
12년 전 조회 3,248
12년 전 조회 2,669
12년 전 조회 2,350
12년 전 조회 2,802
12년 전 조회 3,543
12년 전 조회 2,762
12년 전 조회 2,567
12년 전 조회 3,125
12년 전 조회 1.6만
12년 전 조회 2,391
12년 전 조회 2,189
12년 전 조회 3,999
12년 전 조회 1만
12년 전 조회 2,569
12년 전 조회 2,507
12년 전 조회 2,948
12년 전 조회 2,407
12년 전 조회 2,585
12년 전 조회 4,843
12년 전 조회 2,786
12년 전 조회 3,449
13년 전 조회 2,447
13년 전 조회 2,619
13년 전 조회 4,340
13년 전 조회 2,183
13년 전 조회 2,683
13년 전 조회 2,987
13년 전 조회 3,436
13년 전 조회 3,543
13년 전 조회 3,992
13년 전 조회 2,454
13년 전 조회 2,461
13년 전 조회 5,848
13년 전 조회 2,901
13년 전 조회 3,071
13년 전 조회 6,943
13년 전 조회 4,645
13년 전 조회 3,568
13년 전 조회 2,742
13년 전 조회 4,926
13년 전 조회 3,929
13년 전 조회 3,611
13년 전 조회 3,289
13년 전 조회 2,975
13년 전 조회 2,943
13년 전 조회 2,699
13년 전 조회 3,829
13년 전 조회 3,138
13년 전 조회 2,766
13년 전 조회 3,842
13년 전 조회 3,053
13년 전 조회 3,639
13년 전 조회 4,872
13년 전 조회 2,630
13년 전 조회 3,595
13년 전 조회 2,439
13년 전 조회 2,926
13년 전 조회 3,543
13년 전 조회 3,179
13년 전 조회 5,988
13년 전 조회 4,096
13년 전 조회 4,269
13년 전 조회 2,651
13년 전 조회 9,961
13년 전 조회 4,791
13년 전 조회 2,858
13년 전 조회 2,722
13년 전 조회 4,118
13년 전 조회 6,843
13년 전 조회 4,835
13년 전 조회 2,764
13년 전 조회 1.5만
13년 전 조회 2,641
13년 전 조회 2,072
13년 전 조회 5,210
13년 전 조회 2,690
13년 전 조회 1.1만
13년 전 조회 2,254
13년 전 조회 2,528
13년 전 조회 4,689
13년 전 조회 2,291
13년 전 조회 3,195
13년 전 조회 5,123
13년 전 조회 2,492
13년 전 조회 2,402