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,772
12년 전 조회 4,324
12년 전 조회 2,781
12년 전 조회 9,808
12년 전 조회 3,074
12년 전 조회 5,278
12년 전 조회 7,923
12년 전 조회 3,096
12년 전 조회 4,373
12년 전 조회 2,093
12년 전 조회 2,774
12년 전 조회 2,637
12년 전 조회 2,837
12년 전 조회 4,818
12년 전 조회 2,610
12년 전 조회 3,320
12년 전 조회 2,744
12년 전 조회 2,439
12년 전 조회 2,877
12년 전 조회 3,628
13년 전 조회 2,831
13년 전 조회 2,648
13년 전 조회 3,209
13년 전 조회 1.6만
13년 전 조회 2,470
13년 전 조회 2,267
13년 전 조회 4,079
13년 전 조회 1만
13년 전 조회 2,647
13년 전 조회 2,603
13년 전 조회 3,041
13년 전 조회 2,495
13년 전 조회 2,651
13년 전 조회 4,929
13년 전 조회 2,877
13년 전 조회 3,533
13년 전 조회 2,512
13년 전 조회 2,694
13년 전 조회 4,427
13년 전 조회 2,259
13년 전 조회 2,768
13년 전 조회 3,074
13년 전 조회 3,510
13년 전 조회 3,613
13년 전 조회 4,068
13년 전 조회 2,517
13년 전 조회 2,535
13년 전 조회 5,932
13년 전 조회 2,975
13년 전 조회 3,142
13년 전 조회 7,020
13년 전 조회 4,697
13년 전 조회 3,651
13년 전 조회 2,823
13년 전 조회 5,004
13년 전 조회 4,012
13년 전 조회 3,687
13년 전 조회 3,370
13년 전 조회 3,042
13년 전 조회 3,023
13년 전 조회 2,781
13년 전 조회 3,913
13년 전 조회 3,222
13년 전 조회 2,837
13년 전 조회 3,926
13년 전 조회 3,131
13년 전 조회 3,731
13년 전 조회 4,953
13년 전 조회 2,711
13년 전 조회 3,679
13년 전 조회 2,513
13년 전 조회 3,002
13년 전 조회 3,617
13년 전 조회 3,267
13년 전 조회 6,075
13년 전 조회 4,184
13년 전 조회 4,357
13년 전 조회 2,740
13년 전 조회 1만
13년 전 조회 4,872
13년 전 조회 2,950
13년 전 조회 2,822
13년 전 조회 4,217
13년 전 조회 6,940
13년 전 조회 4,930
13년 전 조회 2,860
13년 전 조회 1.5만
13년 전 조회 2,739
13년 전 조회 2,171
13년 전 조회 5,254
13년 전 조회 2,730
13년 전 조회 1.1만
13년 전 조회 2,354
13년 전 조회 2,572
13년 전 조회 4,794
13년 전 조회 2,384
13년 전 조회 3,305
13년 전 조회 5,223
13년 전 조회 2,597
13년 전 조회 2,497