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,224
12년 전 조회 3,770
12년 전 조회 2,268
12년 전 조회 9,360
12년 전 조회 2,509
12년 전 조회 4,772
12년 전 조회 7,375
12년 전 조회 2,545
12년 전 조회 3,823
12년 전 조회 1,521
12년 전 조회 2,239
12년 전 조회 2,117
12년 전 조회 2,277
12년 전 조회 4,288
12년 전 조회 2,043
12년 전 조회 2,793
12년 전 조회 2,222
12년 전 조회 1,877
12년 전 조회 2,325
12년 전 조회 3,032
12년 전 조회 2,319
12년 전 조회 2,141
12년 전 조회 2,670
12년 전 조회 1.6만
12년 전 조회 1,942
12년 전 조회 1,717
12년 전 조회 3,565
12년 전 조회 9,802
12년 전 조회 2,108
12년 전 조회 2,068
12년 전 조회 2,498
12년 전 조회 1,987
12년 전 조회 2,164
12년 전 조회 4,410
12년 전 조회 2,330
12년 전 조회 2,995
12년 전 조회 1,987
12년 전 조회 2,176
12년 전 조회 3,889
12년 전 조회 1,723
12년 전 조회 2,205
12년 전 조회 2,528
12년 전 조회 2,977
12년 전 조회 3,070
12년 전 조회 3,528
12년 전 조회 1,985
12년 전 조회 2,046
12년 전 조회 5,384
12년 전 조회 2,453
12년 전 조회 2,633
12년 전 조회 6,461
12년 전 조회 4,166
12년 전 조회 3,125
12년 전 조회 2,270
12년 전 조회 4,452
12년 전 조회 3,456
12년 전 조회 3,150
12년 전 조회 2,826
12년 전 조회 2,494
12년 전 조회 2,499
12년 전 조회 2,243
12년 전 조회 3,330
12년 전 조회 2,648
12년 전 조회 2,330
12년 전 조회 3,412
12년 전 조회 2,598
12년 전 조회 3,190
12년 전 조회 4,392
12년 전 조회 2,145
12년 전 조회 3,150
13년 전 조회 2,003
13년 전 조회 2,453
13년 전 조회 3,120
13년 전 조회 2,733
13년 전 조회 5,544
13년 전 조회 3,650
13년 전 조회 3,821
13년 전 조회 2,209
13년 전 조회 9,507
13년 전 조회 4,334
13년 전 조회 2,399
13년 전 조회 2,252
13년 전 조회 3,690
13년 전 조회 6,381
13년 전 조회 4,391
13년 전 조회 2,298
13년 전 조회 1.4만
13년 전 조회 2,186
13년 전 조회 1,597
13년 전 조회 4,838
13년 전 조회 2,342
13년 전 조회 1만
13년 전 조회 1,778
13년 전 조회 2,092
13년 전 조회 4,249
13년 전 조회 1,862
13년 전 조회 2,755
13년 전 조회 4,697
13년 전 조회 2,057
13년 전 조회 1,960