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,413
12년 전 조회 3,928
12년 전 조회 2,434
12년 전 조회 9,598
12년 전 조회 2,691
12년 전 조회 4,925
12년 전 조회 7,520
12년 전 조회 2,704
12년 전 조회 4,004
12년 전 조회 1,705
12년 전 조회 2,392
12년 전 조회 2,268
12년 전 조회 2,445
12년 전 조회 4,455
12년 전 조회 2,229
12년 전 조회 2,970
12년 전 조회 2,382
12년 전 조회 2,051
12년 전 조회 2,492
12년 전 조회 3,208
12년 전 조회 2,480
12년 전 조회 2,291
12년 전 조회 2,815
12년 전 조회 1.6만
12년 전 조회 2,090
12년 전 조회 1,892
12년 전 조회 3,705
12년 전 조회 9,956
12년 전 조회 2,255
12년 전 조회 2,209
12년 전 조회 2,658
12년 전 조회 2,118
12년 전 조회 2,274
12년 전 조회 4,544
12년 전 조회 2,485
12년 전 조회 3,152
12년 전 조회 2,134
12년 전 조회 2,315
12년 전 조회 4,030
12년 전 조회 1,876
12년 전 조회 2,358
12년 전 조회 2,694
12년 전 조회 3,125
12년 전 조회 3,228
12년 전 조회 3,694
12년 전 조회 2,142
12년 전 조회 2,183
12년 전 조회 5,551
12년 전 조회 2,605
12년 전 조회 2,784
12년 전 조회 6,612
12년 전 조회 4,346
12년 전 조회 3,273
12년 전 조회 2,444
12년 전 조회 4,631
12년 전 조회 3,615
13년 전 조회 3,320
13년 전 조회 2,969
13년 전 조회 2,651
13년 전 조회 2,669
13년 전 조회 2,397
13년 전 조회 3,495
13년 전 조회 2,816
13년 전 조회 2,475
13년 전 조회 3,526
13년 전 조회 2,748
13년 전 조회 3,329
13년 전 조회 4,560
13년 전 조회 2,326
13년 전 조회 3,332
13년 전 조회 2,156
13년 전 조회 2,618
13년 전 조회 3,259
13년 전 조회 2,894
13년 전 조회 5,681
13년 전 조회 3,793
13년 전 조회 4,002
13년 전 조회 2,354
13년 전 조회 9,666
13년 전 조회 4,502
13년 전 조회 2,556
13년 전 조회 2,425
13년 전 조회 3,828
13년 전 조회 6,546
13년 전 조회 4,552
13년 전 조회 2,469
13년 전 조회 1.5만
13년 전 조회 2,345
13년 전 조회 1,765
13년 전 조회 5,054
13년 전 조회 2,542
13년 전 조회 1만
13년 전 조회 1,953
13년 전 조회 2,352
13년 전 조회 4,409
13년 전 조회 2,006
13년 전 조회 2,905
13년 전 조회 4,843
13년 전 조회 2,224
13년 전 조회 2,123