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,758
12년 전 조회 4,300
12년 전 조회 2,756
12년 전 조회 9,792
12년 전 조회 3,057
12년 전 조회 5,252
12년 전 조회 7,898
12년 전 조회 3,064
12년 전 조회 4,346
12년 전 조회 2,069
12년 전 조회 2,746
12년 전 조회 2,603
12년 전 조회 2,797
12년 전 조회 4,790
12년 전 조회 2,575
12년 전 조회 3,286
12년 전 조회 2,715
12년 전 조회 2,407
12년 전 조회 2,849
12년 전 조회 3,599
12년 전 조회 2,809
12년 전 조회 2,614
12년 전 조회 3,180
13년 전 조회 1.6만
13년 전 조회 2,436
13년 전 조회 2,235
13년 전 조회 4,042
13년 전 조회 1만
13년 전 조회 2,615
13년 전 조회 2,564
13년 전 조회 3,009
13년 전 조회 2,457
13년 전 조회 2,619
13년 전 조회 4,893
13년 전 조회 2,847
13년 전 조회 3,491
13년 전 조회 2,485
13년 전 조회 2,660
13년 전 조회 4,397
13년 전 조회 2,234
13년 전 조회 2,729
13년 전 조회 3,046
13년 전 조회 3,479
13년 전 조회 3,582
13년 전 조회 4,039
13년 전 조회 2,491
13년 전 조회 2,503
13년 전 조회 5,896
13년 전 조회 2,943
13년 전 조회 3,113
13년 전 조회 6,984
13년 전 조회 4,676
13년 전 조회 3,615
13년 전 조회 2,791
13년 전 조회 4,972
13년 전 조회 3,979
13년 전 조회 3,659
13년 전 조회 3,343
13년 전 조회 3,019
13년 전 조회 2,987
13년 전 조회 2,756
13년 전 조회 3,871
13년 전 조회 3,189
13년 전 조회 2,813
13년 전 조회 3,894
13년 전 조회 3,100
13년 전 조회 3,701
13년 전 조회 4,919
13년 전 조회 2,674
13년 전 조회 3,639
13년 전 조회 2,482
13년 전 조회 2,981
13년 전 조회 3,591
13년 전 조회 3,237
13년 전 조회 6,035
13년 전 조회 4,149
13년 전 조회 4,313
13년 전 조회 2,710
13년 전 조회 1만
13년 전 조회 4,842
13년 전 조회 2,907
13년 전 조회 2,784
13년 전 조회 4,173
13년 전 조회 6,906
13년 전 조회 4,901
13년 전 조회 2,813
13년 전 조회 1.5만
13년 전 조회 2,696
13년 전 조회 2,127
13년 전 조회 5,241
13년 전 조회 2,715
13년 전 조회 1.1만
13년 전 조회 2,301
13년 전 조회 2,556
13년 전 조회 4,747
13년 전 조회 2,356
13년 전 조회 3,266
13년 전 조회 5,176
13년 전 조회 2,554
13년 전 조회 2,460