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,393
12년 전 조회 3,901
12년 전 조회 2,416
12년 전 조회 9,564
12년 전 조회 2,671
12년 전 조회 4,904
12년 전 조회 7,502
12년 전 조회 2,692
12년 전 조회 3,976
12년 전 조회 1,676
12년 전 조회 2,374
12년 전 조회 2,247
12년 전 조회 2,428
12년 전 조회 4,434
12년 전 조회 2,214
12년 전 조회 2,948
12년 전 조회 2,361
12년 전 조회 2,026
12년 전 조회 2,478
12년 전 조회 3,189
12년 전 조회 2,464
12년 전 조회 2,267
12년 전 조회 2,801
12년 전 조회 1.6만
12년 전 조회 2,076
12년 전 조회 1,865
12년 전 조회 3,689
12년 전 조회 9,935
12년 전 조회 2,241
12년 전 조회 2,187
12년 전 조회 2,637
12년 전 조회 2,105
12년 전 조회 2,260
12년 전 조회 4,532
12년 전 조회 2,468
12년 전 조회 3,126
12년 전 조회 2,124
12년 전 조회 2,293
12년 전 조회 4,010
12년 전 조회 1,848
12년 전 조회 2,337
12년 전 조회 2,668
12년 전 조회 3,107
12년 전 조회 3,201
12년 전 조회 3,672
12년 전 조회 2,129
12년 전 조회 2,163
12년 전 조회 5,532
12년 전 조회 2,586
12년 전 조회 2,767
12년 전 조회 6,597
12년 전 조회 4,324
12년 전 조회 3,255
12년 전 조회 2,429
12년 전 조회 4,606
12년 전 조회 3,589
12년 전 조회 3,299
13년 전 조회 2,956
13년 전 조회 2,636
13년 전 조회 2,651
13년 전 조회 2,379
13년 전 조회 3,475
13년 전 조회 2,792
13년 전 조회 2,451
13년 전 조회 3,510
13년 전 조회 2,738
13년 전 조회 3,310
13년 전 조회 4,535
13년 전 조회 2,300
13년 전 조회 3,309
13년 전 조회 2,142
13년 전 조회 2,597
13년 전 조회 3,245
13년 전 조회 2,875
13년 전 조회 5,664
13년 전 조회 3,774
13년 전 조회 3,975
13년 전 조회 2,342
13년 전 조회 9,656
13년 전 조회 4,480
13년 전 조회 2,537
13년 전 조회 2,398
13년 전 조회 3,814
13년 전 조회 6,532
13년 전 조회 4,533
13년 전 조회 2,447
13년 전 조회 1.5만
13년 전 조회 2,328
13년 전 조회 1,737
13년 전 조회 5,034
13년 전 조회 2,506
13년 전 조회 1만
13년 전 조회 1,926
13년 전 조회 2,324
13년 전 조회 4,386
13년 전 조회 1,993
13년 전 조회 2,892
13년 전 조회 4,819
13년 전 조회 2,206
13년 전 조회 2,107