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,096
12년 전 조회 3,632
12년 전 조회 2,130
12년 전 조회 9,316
12년 전 조회 2,365
12년 전 조회 4,597
12년 전 조회 7,250
12년 전 조회 2,400
12년 전 조회 3,665
12년 전 조회 1,392
12년 전 조회 2,094
12년 전 조회 1,980
12년 전 조회 2,149
12년 전 조회 4,144
12년 전 조회 1,909
12년 전 조회 2,662
12년 전 조회 2,101
12년 전 조회 1,740
12년 전 조회 2,174
12년 전 조회 2,903
12년 전 조회 2,190
12년 전 조회 2,021
12년 전 조회 2,543
12년 전 조회 1.6만
12년 전 조회 1,816
12년 전 조회 1,591
12년 전 조회 3,444
12년 전 조회 9,679
12년 전 조회 1,997
12년 전 조회 1,935
12년 전 조회 2,383
12년 전 조회 1,862
12년 전 조회 2,036
12년 전 조회 4,297
12년 전 조회 2,212
12년 전 조회 2,876
12년 전 조회 1,869
12년 전 조회 2,051
12년 전 조회 3,756
12년 전 조회 1,600
12년 전 조회 2,079
12년 전 조회 2,408
12년 전 조회 2,835
12년 전 조회 2,941
12년 전 조회 3,387
12년 전 조회 1,848
12년 전 조회 1,901
12년 전 조회 5,262
12년 전 조회 2,312
12년 전 조회 2,507
12년 전 조회 6,314
12년 전 조회 4,035
12년 전 조회 2,989
12년 전 조회 2,139
12년 전 조회 4,308
12년 전 조회 3,318
12년 전 조회 3,006
12년 전 조회 2,670
12년 전 조회 2,349
12년 전 조회 2,374
12년 전 조회 2,114
12년 전 조회 3,184
12년 전 조회 2,506
12년 전 조회 2,211
12년 전 조회 3,267
12년 전 조회 2,451
12년 전 조회 3,046
12년 전 조회 4,259
12년 전 조회 2,011
12년 전 조회 3,004
12년 전 조회 1,856
12년 전 조회 2,338
12년 전 조회 2,972
12년 전 조회 2,592
12년 전 조회 5,394
12년 전 조회 3,520
12년 전 조회 3,699
12년 전 조회 2,069
12년 전 조회 9,383
12년 전 조회 4,205
13년 전 조회 2,251
13년 전 조회 2,129
13년 전 조회 3,557
13년 전 조회 6,239
13년 전 조회 4,264
13년 전 조회 2,172
13년 전 조회 1.4만
13년 전 조회 2,045
13년 전 조회 1,467
13년 전 조회 4,794
13년 전 조회 2,288
13년 전 조회 1만
13년 전 조회 1,645
13년 전 조회 2,054
13년 전 조회 4,103
13년 전 조회 1,734
13년 전 조회 2,630
13년 전 조회 4,611
13년 전 조회 1,926
13년 전 조회 1,807