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년 전 조회 1,561
12년 전 조회 3,115
12년 전 조회 1,576
12년 전 조회 8,775
12년 전 조회 1,830
12년 전 조회 4,078
12년 전 조회 6,714
12년 전 조회 1,881
12년 전 조회 3,159
12년 전 조회 908
12년 전 조회 1,589
12년 전 조회 1,450
12년 전 조회 1,628
12년 전 조회 3,609
12년 전 조회 1,407
12년 전 조회 2,116
12년 전 조회 1,555
12년 전 조회 1,213
12년 전 조회 1,688
12년 전 조회 2,413
12년 전 조회 1,693
12년 전 조회 1,594
12년 전 조회 2,101
12년 전 조회 1.5만
12년 전 조회 1,368
12년 전 조회 1,177
12년 전 조회 3,016
12년 전 조회 9,255
12년 전 조회 1,558
12년 전 조회 1,502
12년 전 조회 1,938
12년 전 조회 1,444
12년 전 조회 1,594
12년 전 조회 3,883
12년 전 조회 1,776
12년 전 조회 2,443
12년 전 조회 1,469
12년 전 조회 1,611
12년 전 조회 3,329
12년 전 조회 1,182
12년 전 조회 1,638
12년 전 조회 1,906
12년 전 조회 2,331
12년 전 조회 2,449
12년 전 조회 2,869
12년 전 조회 1,341
12년 전 조회 1,366
12년 전 조회 4,755
12년 전 조회 1,796
12년 전 조회 1,943
12년 전 조회 5,795
12년 전 조회 3,537
12년 전 조회 2,443
12년 전 조회 1,603
12년 전 조회 3,783
12년 전 조회 2,811
12년 전 조회 2,511
12년 전 조회 2,158
12년 전 조회 1,836
12년 전 조회 1,838
12년 전 조회 1,589
12년 전 조회 2,714
12년 전 조회 1,989
12년 전 조회 1,662
12년 전 조회 2,743
12년 전 조회 1,935
12년 전 조회 2,546
12년 전 조회 3,752
12년 전 조회 1,537
12년 전 조회 2,492
12년 전 조회 1,351
12년 전 조회 1,838
12년 전 조회 2,419
12년 전 조회 2,047
12년 전 조회 4,857
12년 전 조회 2,963
12년 전 조회 3,136
12년 전 조회 1,506
12년 전 조회 8,828
12년 전 조회 3,658
12년 전 조회 1,746
12년 전 조회 1,595
12년 전 조회 3,001
12년 전 조회 5,666
12년 전 조회 3,711
12년 전 조회 1,657
12년 전 조회 1.4만
12년 전 조회 1,511
12년 전 조회 910
12년 전 조회 4,234
12년 전 조회 1,738
12년 전 조회 9,614
12년 전 조회 1,105
12년 전 조회 1,546
12년 전 조회 3,510
12년 전 조회 1,145
12년 전 조회 2,056
12년 전 조회 3,966
12년 전 조회 1,363
12년 전 조회 1,266