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,732
12년 전 조회 4,284
12년 전 조회 2,733
12년 전 조회 9,780
12년 전 조회 3,027
12년 전 조회 5,234
12년 전 조회 7,870
12년 전 조회 3,035
12년 전 조회 4,329
12년 전 조회 2,047
12년 전 조회 2,727
12년 전 조회 2,587
12년 전 조회 2,767
12년 전 조회 4,764
12년 전 조회 2,558
12년 전 조회 3,265
12년 전 조회 2,693
12년 전 조회 2,375
12년 전 조회 2,836
12년 전 조회 3,573
12년 전 조회 2,791
12년 전 조회 2,599
12년 전 조회 3,151
12년 전 조회 1.6만
12년 전 조회 2,415
13년 전 조회 2,217
13년 전 조회 4,023
13년 전 조회 1만
13년 전 조회 2,594
13년 전 조회 2,537
13년 전 조회 2,982
13년 전 조회 2,427
13년 전 조회 2,605
13년 전 조회 4,868
13년 전 조회 2,816
13년 전 조회 3,469
13년 전 조회 2,470
13년 전 조회 2,646
13년 전 조회 4,375
13년 전 조회 2,210
13년 전 조회 2,715
13년 전 조회 3,015
13년 전 조회 3,454
13년 전 조회 3,568
13년 전 조회 4,018
13년 전 조회 2,473
13년 전 조회 2,484
13년 전 조회 5,874
13년 전 조회 2,921
13년 전 조회 3,088
13년 전 조회 6,965
13년 전 조회 4,663
13년 전 조회 3,592
13년 전 조회 2,770
13년 전 조회 4,947
13년 전 조회 3,961
13년 전 조회 3,639
13년 전 조회 3,314
13년 전 조회 3,001
13년 전 조회 2,966
13년 전 조회 2,728
13년 전 조회 3,852
13년 전 조회 3,161
13년 전 조회 2,786
13년 전 조회 3,870
13년 전 조회 3,081
13년 전 조회 3,675
13년 전 조회 4,899
13년 전 조회 2,655
13년 전 조회 3,618
13년 전 조회 2,461
13년 전 조회 2,954
13년 전 조회 3,561
13년 전 조회 3,206
13년 전 조회 6,014
13년 전 조회 4,126
13년 전 조회 4,284
13년 전 조회 2,678
13년 전 조회 9,990
13년 전 조회 4,812
13년 전 조회 2,886
13년 전 조회 2,760
13년 전 조회 4,150
13년 전 조회 6,872
13년 전 조회 4,865
13년 전 조회 2,791
13년 전 조회 1.5만
13년 전 조회 2,668
13년 전 조회 2,093
13년 전 조회 5,229
13년 전 조회 2,703
13년 전 조회 1.1만
13년 전 조회 2,278
13년 전 조회 2,540
13년 전 조회 4,720
13년 전 조회 2,329
13년 전 조회 3,232
13년 전 조회 5,148
13년 전 조회 2,524
13년 전 조회 2,431