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,671
12년 전 조회 4,224
12년 전 조회 2,672
12년 전 조회 9,748
12년 전 조회 2,974
12년 전 조회 5,167
12년 전 조회 7,794
12년 전 조회 2,967
12년 전 조회 4,264
12년 전 조회 1,983
12년 전 조회 2,657
12년 전 조회 2,528
12년 전 조회 2,700
12년 전 조회 4,702
12년 전 조회 2,500
12년 전 조회 3,210
12년 전 조회 2,640
12년 전 조회 2,319
12년 전 조회 2,768
12년 전 조회 3,508
12년 전 조회 2,730
12년 전 조회 2,530
12년 전 조회 3,092
12년 전 조회 1.6만
12년 전 조회 2,360
12년 전 조회 2,167
12년 전 조회 3,967
12년 전 조회 1만
12년 전 조회 2,529
12년 전 조회 2,475
12년 전 조회 2,913
12년 전 조회 2,373
12년 전 조회 2,550
12년 전 조회 4,807
12년 전 조회 2,758
12년 전 조회 3,416
12년 전 조회 2,404
12년 전 조회 2,582
12년 전 조회 4,307
13년 전 조회 2,148
13년 전 조회 2,643
13년 전 조회 2,952
13년 전 조회 3,397
13년 전 조회 3,503
13년 전 조회 3,951
13년 전 조회 2,409
13년 전 조회 2,424
13년 전 조회 5,805
13년 전 조회 2,859
13년 전 조회 3,036
13년 전 조회 6,912
13년 전 조회 4,605
13년 전 조회 3,526
13년 전 조회 2,711
13년 전 조회 4,893
13년 전 조회 3,874
13년 전 조회 3,569
13년 전 조회 3,246
13년 전 조회 2,937
13년 전 조회 2,912
13년 전 조회 2,663
13년 전 조회 3,793
13년 전 조회 3,089
13년 전 조회 2,724
13년 전 조회 3,803
13년 전 조회 3,019
13년 전 조회 3,600
13년 전 조회 4,835
13년 전 조회 2,594
13년 전 조회 3,566
13년 전 조회 2,406
13년 전 조회 2,877
13년 전 조회 3,501
13년 전 조회 3,144
13년 전 조회 5,940
13년 전 조회 4,049
13년 전 조회 4,233
13년 전 조회 2,607
13년 전 조회 9,934
13년 전 조회 4,761
13년 전 조회 2,824
13년 전 조회 2,687
13년 전 조회 4,086
13년 전 조회 6,805
13년 전 조회 4,808
13년 전 조회 2,725
13년 전 조회 1.5만
13년 전 조회 2,611
13년 전 조회 2,029
13년 전 조회 5,199
13년 전 조회 2,670
13년 전 조회 1.1만
13년 전 조회 2,212
13년 전 조회 2,511
13년 전 조회 4,641
13년 전 조회 2,259
13년 전 조회 3,151
13년 전 조회 5,077
13년 전 조회 2,459
13년 전 조회 2,368