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,740
12년 전 조회 4,288
12년 전 조회 2,737
12년 전 조회 9,782
12년 전 조회 3,034
12년 전 조회 5,240
12년 전 조회 7,877
12년 전 조회 3,044
12년 전 조회 4,335
12년 전 조회 2,052
12년 전 조회 2,732
12년 전 조회 2,592
12년 전 조회 2,775
12년 전 조회 4,772
12년 전 조회 2,565
12년 전 조회 3,271
12년 전 조회 2,699
12년 전 조회 2,381
12년 전 조회 2,840
12년 전 조회 3,579
12년 전 조회 2,794
12년 전 조회 2,604
12년 전 조회 3,158
12년 전 조회 1.6만
12년 전 조회 2,419
13년 전 조회 2,222
13년 전 조회 4,027
13년 전 조회 1만
13년 전 조회 2,597
13년 전 조회 2,541
13년 전 조회 2,986
13년 전 조회 2,433
13년 전 조회 2,608
13년 전 조회 4,875
13년 전 조회 2,821
13년 전 조회 3,477
13년 전 조회 2,471
13년 전 조회 2,653
13년 전 조회 4,381
13년 전 조회 2,216
13년 전 조회 2,720
13년 전 조회 3,020
13년 전 조회 3,465
13년 전 조회 3,570
13년 전 조회 4,024
13년 전 조회 2,482
13년 전 조회 2,485
13년 전 조회 5,879
13년 전 조회 2,928
13년 전 조회 3,094
13년 전 조회 6,973
13년 전 조회 4,668
13년 전 조회 3,594
13년 전 조회 2,771
13년 전 조회 4,954
13년 전 조회 3,963
13년 전 조회 3,643
13년 전 조회 3,325
13년 전 조회 3,005
13년 전 조회 2,975
13년 전 조회 2,736
13년 전 조회 3,856
13년 전 조회 3,166
13년 전 조회 2,794
13년 전 조회 3,878
13년 전 조회 3,083
13년 전 조회 3,680
13년 전 조회 4,904
13년 전 조회 2,659
13년 전 조회 3,623
13년 전 조회 2,466
13년 전 조회 2,960
13년 전 조회 3,569
13년 전 조회 3,219
13년 전 조회 6,019
13년 전 조회 4,131
13년 전 조회 4,291
13년 전 조회 2,688
13년 전 조회 9,999
13년 전 조회 4,820
13년 전 조회 2,889
13년 전 조회 2,766
13년 전 조회 4,158
13년 전 조회 6,884
13년 전 조회 4,882
13년 전 조회 2,798
13년 전 조회 1.5만
13년 전 조회 2,673
13년 전 조회 2,103
13년 전 조회 5,234
13년 전 조회 2,705
13년 전 조회 1.1만
13년 전 조회 2,284
13년 전 조회 2,544
13년 전 조회 4,725
13년 전 조회 2,335
13년 전 조회 3,246
13년 전 조회 5,159
13년 전 조회 2,533
13년 전 조회 2,440