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,750
12년 전 조회 4,291
12년 전 조회 2,744
12년 전 조회 9,787
12년 전 조회 3,043
12년 전 조회 5,245
12년 전 조회 7,883
12년 전 조회 3,051
12년 전 조회 4,340
12년 전 조회 2,061
12년 전 조회 2,739
12년 전 조회 2,596
12년 전 조회 2,786
12년 전 조회 4,780
12년 전 조회 2,572
12년 전 조회 3,277
12년 전 조회 2,704
12년 전 조회 2,391
12년 전 조회 2,846
12년 전 조회 3,587
12년 전 조회 2,797
12년 전 조회 2,607
12년 전 조회 3,168
12년 전 조회 1.6만
13년 전 조회 2,427
13년 전 조회 2,230
13년 전 조회 4,036
13년 전 조회 1만
13년 전 조회 2,610
13년 전 조회 2,552
13년 전 조회 3,000
13년 전 조회 2,441
13년 전 조회 2,613
13년 전 조회 4,885
13년 전 조회 2,835
13년 전 조회 3,484
13년 전 조회 2,477
13년 전 조회 2,657
13년 전 조회 4,385
13년 전 조회 2,226
13년 전 조회 2,723
13년 전 조회 3,033
13년 전 조회 3,471
13년 전 조회 3,578
13년 전 조회 4,032
13년 전 조회 2,485
13년 전 조회 2,494
13년 전 조회 5,888
13년 전 조회 2,933
13년 전 조회 3,104
13년 전 조회 6,979
13년 전 조회 4,674
13년 전 조회 3,608
13년 전 조회 2,780
13년 전 조회 4,963
13년 전 조회 3,969
13년 전 조회 3,652
13년 전 조회 3,329
13년 전 조회 3,012
13년 전 조회 2,981
13년 전 조회 2,747
13년 전 조회 3,864
13년 전 조회 3,173
13년 전 조회 2,800
13년 전 조회 3,887
13년 전 조회 3,091
13년 전 조회 3,689
13년 전 조회 4,914
13년 전 조회 2,664
13년 전 조회 3,629
13년 전 조회 2,475
13년 전 조회 2,972
13년 전 조회 3,580
13년 전 조회 3,228
13년 전 조회 6,024
13년 전 조회 4,139
13년 전 조회 4,300
13년 전 조회 2,697
13년 전 조회 1만
13년 전 조회 4,825
13년 전 조회 2,897
13년 전 조회 2,777
13년 전 조회 4,166
13년 전 조회 6,892
13년 전 조회 4,891
13년 전 조회 2,807
13년 전 조회 1.5만
13년 전 조회 2,684
13년 전 조회 2,117
13년 전 조회 5,240
13년 전 조회 2,712
13년 전 조회 1.1만
13년 전 조회 2,294
13년 전 조회 2,548
13년 전 조회 4,736
13년 전 조회 2,342
13년 전 조회 3,254
13년 전 조회 5,167
13년 전 조회 2,543
13년 전 조회 2,446