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,631
12년 전 조회 4,160
12년 전 조회 2,628
12년 전 조회 9,721
12년 전 조회 2,924
12년 전 조회 5,110
12년 전 조회 7,734
12년 전 조회 2,917
12년 전 조회 4,225
12년 전 조회 1,936
12년 전 조회 2,613
12년 전 조회 2,481
12년 전 조회 2,655
12년 전 조회 4,648
12년 전 조회 2,452
12년 전 조회 3,161
12년 전 조회 2,591
12년 전 조회 2,262
12년 전 조회 2,715
12년 전 조회 3,451
12년 전 조회 2,686
12년 전 조회 2,485
12년 전 조회 3,038
12년 전 조회 1.6만
12년 전 조회 2,314
12년 전 조회 2,121
12년 전 조회 3,913
12년 전 조회 1만
12년 전 조회 2,477
12년 전 조회 2,420
12년 전 조회 2,867
12년 전 조회 2,319
12년 전 조회 2,491
12년 전 조회 4,758
12년 전 조회 2,708
12년 전 조회 3,358
12년 전 조회 2,359
12년 전 조회 2,521
12년 전 조회 4,239
12년 전 조회 2,102
12년 전 조회 2,586
12년 전 조회 2,898
13년 전 조회 3,350
13년 전 조회 3,463
13년 전 조회 3,894
13년 전 조회 2,356
13년 전 조회 2,373
13년 전 조회 5,753
13년 전 조회 2,811
13년 전 조회 2,977
13년 전 조회 6,853
13년 전 조회 4,556
13년 전 조회 3,469
13년 전 조회 2,671
13년 전 조회 4,840
13년 전 조회 3,828
13년 전 조회 3,523
13년 전 조회 3,194
13년 전 조회 2,871
13년 전 조회 2,858
13년 전 조회 2,598
13년 전 조회 3,732
13년 전 조회 3,029
13년 전 조회 2,662
13년 전 조회 3,740
13년 전 조회 2,964
13년 전 조회 3,540
13년 전 조회 4,780
13년 전 조회 2,546
13년 전 조회 3,517
13년 전 조회 2,359
13년 전 조회 2,823
13년 전 조회 3,452
13년 전 조회 3,091
13년 전 조회 5,898
13년 전 조회 3,995
13년 전 조회 4,184
13년 전 조회 2,543
13년 전 조회 9,883
13년 전 조회 4,707
13년 전 조회 2,768
13년 전 조회 2,648
13년 전 조회 4,033
13년 전 조회 6,748
13년 전 조회 4,754
13년 전 조회 2,689
13년 전 조회 1.5만
13년 전 조회 2,551
13년 전 조회 1,975
13년 전 조회 5,164
13년 전 조회 2,650
13년 전 조회 1.1만
13년 전 조회 2,158
13년 전 조회 2,479
13년 전 조회 4,599
13년 전 조회 2,207
13년 전 조회 3,106
13년 전 조회 5,031
13년 전 조회 2,413
13년 전 조회 2,310