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년 전 조회 1,537
12년 전 조회 3,092
12년 전 조회 1,559
12년 전 조회 8,747
12년 전 조회 1,809
12년 전 조회 4,054
12년 전 조회 6,683
12년 전 조회 1,857
12년 전 조회 3,140
12년 전 조회 889
12년 전 조회 1,573
12년 전 조회 1,430
12년 전 조회 1,590
12년 전 조회 3,587
12년 전 조회 1,377
12년 전 조회 2,091
12년 전 조회 1,541
12년 전 조회 1,199
12년 전 조회 1,676
12년 전 조회 2,397
12년 전 조회 1,666
12년 전 조회 1,574
12년 전 조회 2,081
12년 전 조회 1.5만
12년 전 조회 1,345
12년 전 조회 1,159
12년 전 조회 3,001
12년 전 조회 9,236
12년 전 조회 1,542
12년 전 조회 1,471
12년 전 조회 1,916
12년 전 조회 1,416
12년 전 조회 1,564
12년 전 조회 3,850
12년 전 조회 1,748
12년 전 조회 2,416
12년 전 조회 1,448
12년 전 조회 1,591
12년 전 조회 3,302
12년 전 조회 1,161
12년 전 조회 1,611
12년 전 조회 1,887
12년 전 조회 2,310
12년 전 조회 2,429
12년 전 조회 2,852
12년 전 조회 1,316
12년 전 조회 1,337
12년 전 조회 4,741
12년 전 조회 1,771
12년 전 조회 1,920
12년 전 조회 5,776
12년 전 조회 3,517
12년 전 조회 2,421
12년 전 조회 1,577
12년 전 조회 3,763
12년 전 조회 2,789
12년 전 조회 2,490
12년 전 조회 2,131
12년 전 조회 1,812
12년 전 조회 1,811
12년 전 조회 1,569
12년 전 조회 2,693
12년 전 조회 1,963
12년 전 조회 1,642
12년 전 조회 2,720
12년 전 조회 1,905
12년 전 조회 2,527
12년 전 조회 3,733
12년 전 조회 1,522
12년 전 조회 2,477
12년 전 조회 1,334
12년 전 조회 1,824
12년 전 조회 2,401
12년 전 조회 2,028
12년 전 조회 4,835
12년 전 조회 2,945
12년 전 조회 3,119
12년 전 조회 1,482
12년 전 조회 8,801
12년 전 조회 3,636
12년 전 조회 1,722
12년 전 조회 1,580
12년 전 조회 2,974
12년 전 조회 5,646
12년 전 조회 3,690
12년 전 조회 1,645
12년 전 조회 1.4만
12년 전 조회 1,499
12년 전 조회 899
12년 전 조회 4,209
12년 전 조회 1,717
12년 전 조회 9,595
12년 전 조회 1,085
12년 전 조회 1,519
12년 전 조회 3,484
12년 전 조회 1,130
12년 전 조회 2,034
12년 전 조회 3,940
12년 전 조회 1,348
12년 전 조회 1,251