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,575
12년 전 조회 4,100
12년 전 조회 2,564
12년 전 조회 9,702
12년 전 조회 2,854
12년 전 조회 5,067
12년 전 조회 7,676
12년 전 조회 2,847
12년 전 조회 4,159
12년 전 조회 1,871
12년 전 조회 2,546
12년 전 조회 2,413
12년 전 조회 2,597
12년 전 조회 4,604
12년 전 조회 2,380
12년 전 조회 3,100
12년 전 조회 2,532
12년 전 조회 2,205
12년 전 조회 2,650
12년 전 조회 3,386
12년 전 조회 2,638
12년 전 조회 2,427
12년 전 조회 2,968
12년 전 조회 1.6만
12년 전 조회 2,247
12년 전 조회 2,060
12년 전 조회 3,843
12년 전 조회 1만
12년 전 조회 2,413
12년 전 조회 2,354
12년 전 조회 2,802
12년 전 조회 2,261
12년 전 조회 2,419
12년 전 조회 4,689
12년 전 조회 2,633
12년 전 조회 3,299
12년 전 조회 2,294
12년 전 조회 2,456
12년 전 조회 4,174
12년 전 조회 2,041
12년 전 조회 2,523
12년 전 조회 2,843
12년 전 조회 3,278
13년 전 조회 3,394
13년 전 조회 3,857
13년 전 조회 2,286
13년 전 조회 2,301
13년 전 조회 5,694
13년 전 조회 2,755
13년 전 조회 2,921
13년 전 조회 6,782
13년 전 조회 4,495
13년 전 조회 3,416
13년 전 조회 2,612
13년 전 조회 4,772
13년 전 조회 3,763
13년 전 조회 3,464
13년 전 조회 3,113
13년 전 조회 2,813
13년 전 조회 2,796
13년 전 조회 2,528
13년 전 조회 3,653
13년 전 조회 2,950
13년 전 조회 2,602
13년 전 조회 3,669
13년 전 조회 2,890
13년 전 조회 3,484
13년 전 조회 4,718
13년 전 조회 2,475
13년 전 조회 3,459
13년 전 조회 2,297
13년 전 조회 2,752
13년 전 조회 3,393
13년 전 조회 3,034
13년 전 조회 5,831
13년 전 조회 3,945
13년 전 조회 4,134
13년 전 조회 2,478
13년 전 조회 9,809
13년 전 조회 4,648
13년 전 조회 2,706
13년 전 조회 2,575
13년 전 조회 3,958
13년 전 조회 6,686
13년 전 조회 4,700
13년 전 조회 2,627
13년 전 조회 1.5만
13년 전 조회 2,490
13년 전 조회 1,916
13년 전 조회 5,146
13년 전 조회 2,635
13년 전 조회 1.1만
13년 전 조회 2,094
13년 전 조회 2,455
13년 전 조회 4,539
13년 전 조회 2,153
13년 전 조회 3,052
13년 전 조회 4,979
13년 전 조회 2,362
13년 전 조회 2,253