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,733
12년 전 조회 4,287
12년 전 조회 2,733
12년 전 조회 9,781
12년 전 조회 3,029
12년 전 조회 5,236
12년 전 조회 7,870
12년 전 조회 3,036
12년 전 조회 4,332
12년 전 조회 2,048
12년 전 조회 2,727
12년 전 조회 2,589
12년 전 조회 2,768
12년 전 조회 4,765
12년 전 조회 2,559
12년 전 조회 3,266
12년 전 조회 2,696
12년 전 조회 2,377
12년 전 조회 2,838
12년 전 조회 3,574
12년 전 조회 2,792
12년 전 조회 2,599
12년 전 조회 3,151
12년 전 조회 1.6만
12년 전 조회 2,416
13년 전 조회 2,219
13년 전 조회 4,023
13년 전 조회 1만
13년 전 조회 2,597
13년 전 조회 2,537
13년 전 조회 2,984
13년 전 조회 2,428
13년 전 조회 2,606
13년 전 조회 4,868
13년 전 조회 2,818
13년 전 조회 3,472
13년 전 조회 2,471
13년 전 조회 2,647
13년 전 조회 4,377
13년 전 조회 2,214
13년 전 조회 2,716
13년 전 조회 3,015
13년 전 조회 3,459
13년 전 조회 3,570
13년 전 조회 4,018
13년 전 조회 2,474
13년 전 조회 2,485
13년 전 조회 5,875
13년 전 조회 2,921
13년 전 조회 3,090
13년 전 조회 6,967
13년 전 조회 4,665
13년 전 조회 3,592
13년 전 조회 2,770
13년 전 조회 4,948
13년 전 조회 3,961
13년 전 조회 3,639
13년 전 조회 3,315
13년 전 조회 3,002
13년 전 조회 2,967
13년 전 조회 2,728
13년 전 조회 3,854
13년 전 조회 3,162
13년 전 조회 2,788
13년 전 조회 3,872
13년 전 조회 3,081
13년 전 조회 3,675
13년 전 조회 4,900
13년 전 조회 2,656
13년 전 조회 3,618
13년 전 조회 2,461
13년 전 조회 2,954
13년 전 조회 3,567
13년 전 조회 3,209
13년 전 조회 6,016
13년 전 조회 4,127
13년 전 조회 4,285
13년 전 조회 2,681
13년 전 조회 9,992
13년 전 조회 4,813
13년 전 조회 2,886
13년 전 조회 2,762
13년 전 조회 4,153
13년 전 조회 6,875
13년 전 조회 4,868
13년 전 조회 2,795
13년 전 조회 1.5만
13년 전 조회 2,668
13년 전 조회 2,099
13년 전 조회 5,229
13년 전 조회 2,704
13년 전 조회 1.1만
13년 전 조회 2,278
13년 전 조회 2,540
13년 전 조회 4,722
13년 전 조회 2,332
13년 전 조회 3,237
13년 전 조회 5,151
13년 전 조회 2,525
13년 전 조회 2,432