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,792
12년 전 조회 4,338
12년 전 조회 2,792
12년 전 조회 9,818
12년 전 조회 3,095
12년 전 조회 5,294
12년 전 조회 7,936
12년 전 조회 3,113
12년 전 조회 4,386
12년 전 조회 2,114
12년 전 조회 2,786
12년 전 조회 2,655
12년 전 조회 2,851
12년 전 조회 4,836
12년 전 조회 2,627
12년 전 조회 3,331
12년 전 조회 2,758
12년 전 조회 2,456
12년 전 조회 2,889
13년 전 조회 3,642
13년 전 조회 2,847
13년 전 조회 2,673
13년 전 조회 3,229
13년 전 조회 1.6만
13년 전 조회 2,488
13년 전 조회 2,280
13년 전 조회 4,105
13년 전 조회 1만
13년 전 조회 2,661
13년 전 조회 2,619
13년 전 조회 3,053
13년 전 조회 2,515
13년 전 조회 2,670
13년 전 조회 4,947
13년 전 조회 2,899
13년 전 조회 3,553
13년 전 조회 2,533
13년 전 조회 2,720
13년 전 조회 4,448
13년 전 조회 2,287
13년 전 조회 2,786
13년 전 조회 3,087
13년 전 조회 3,530
13년 전 조회 3,631
13년 전 조회 4,082
13년 전 조회 2,543
13년 전 조회 2,555
13년 전 조회 5,944
13년 전 조회 3,006
13년 전 조회 3,167
13년 전 조회 7,040
13년 전 조회 4,713
13년 전 조회 3,665
13년 전 조회 2,842
13년 전 조회 5,018
13년 전 조회 4,032
13년 전 조회 3,701
13년 전 조회 3,394
13년 전 조회 3,063
13년 전 조회 3,049
13년 전 조회 2,807
13년 전 조회 3,928
13년 전 조회 3,237
13년 전 조회 2,858
13년 전 조회 3,946
13년 전 조회 3,158
13년 전 조회 3,755
13년 전 조회 4,966
13년 전 조회 2,737
13년 전 조회 3,696
13년 전 조회 2,532
13년 전 조회 3,025
13년 전 조회 3,636
13년 전 조회 3,288
13년 전 조회 6,100
13년 전 조회 4,208
13년 전 조회 4,387
13년 전 조회 2,765
13년 전 조회 1만
13년 전 조회 4,900
13년 전 조회 2,973
13년 전 조회 2,847
13년 전 조회 4,238
13년 전 조회 6,974
13년 전 조회 4,956
13년 전 조회 2,883
13년 전 조회 1.5만
13년 전 조회 2,764
13년 전 조회 2,193
13년 전 조회 5,265
13년 전 조회 2,737
13년 전 조회 1.1만
13년 전 조회 2,383
13년 전 조회 2,574
13년 전 조회 4,810
13년 전 조회 2,408
13년 전 조회 3,334
13년 전 조회 5,250
13년 전 조회 2,620
13년 전 조회 2,513