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,688
12년 전 조회 4,247
12년 전 조회 2,692
12년 전 조회 9,756
12년 전 조회 2,987
12년 전 조회 5,186
12년 전 조회 7,806
12년 전 조회 2,986
12년 전 조회 4,279
12년 전 조회 2,005
12년 전 조회 2,674
12년 전 조회 2,542
12년 전 조회 2,712
12년 전 조회 4,721
12년 전 조회 2,516
12년 전 조회 3,230
12년 전 조회 2,658
12년 전 조회 2,334
12년 전 조회 2,785
12년 전 조회 3,518
12년 전 조회 2,742
12년 전 조회 2,548
12년 전 조회 3,103
12년 전 조회 1.6만
12년 전 조회 2,372
12년 전 조회 2,177
12년 전 조회 3,979
12년 전 조회 1만
12년 전 조회 2,553
12년 전 조회 2,492
12년 전 조회 2,930
12년 전 조회 2,392
12년 전 조회 2,565
12년 전 조회 4,823
12년 전 조회 2,767
12년 전 조회 3,433
12년 전 조회 2,427
12년 전 조회 2,601
13년 전 조회 4,322
13년 전 조회 2,165
13년 전 조회 2,656
13년 전 조회 2,967
13년 전 조회 3,407
13년 전 조회 3,522
13년 전 조회 3,967
13년 전 조회 2,433
13년 전 조회 2,444
13년 전 조회 5,824
13년 전 조회 2,880
13년 전 조회 3,050
13년 전 조회 6,927
13년 전 조회 4,627
13년 전 조회 3,542
13년 전 조회 2,726
13년 전 조회 4,908
13년 전 조회 3,900
13년 전 조회 3,580
13년 전 조회 3,270
13년 전 조회 2,955
13년 전 조회 2,925
13년 전 조회 2,680
13년 전 조회 3,806
13년 전 조회 3,107
13년 전 조회 2,740
13년 전 조회 3,824
13년 전 조회 3,037
13년 전 조회 3,614
13년 전 조회 4,850
13년 전 조회 2,612
13년 전 조회 3,581
13년 전 조회 2,424
13년 전 조회 2,901
13년 전 조회 3,515
13년 전 조회 3,156
13년 전 조회 5,953
13년 전 조회 4,070
13년 전 조회 4,246
13년 전 조회 2,629
13년 전 조회 9,948
13년 전 조회 4,776
13년 전 조회 2,837
13년 전 조회 2,704
13년 전 조회 4,098
13년 전 조회 6,818
13년 전 조회 4,820
13년 전 조회 2,746
13년 전 조회 1.5만
13년 전 조회 2,617
13년 전 조회 2,044
13년 전 조회 5,203
13년 전 조회 2,680
13년 전 조회 1.1만
13년 전 조회 2,228
13년 전 조회 2,519
13년 전 조회 4,652
13년 전 조회 2,273
13년 전 조회 3,170
13년 전 조회 5,104
13년 전 조회 2,474
13년 전 조회 2,378