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,546
12년 전 조회 4,069
12년 전 조회 2,536
12년 전 조회 9,697
12년 전 조회 2,811
12년 전 조회 5,043
12년 전 조회 7,646
12년 전 조회 2,818
12년 전 조회 4,124
12년 전 조회 1,841
12년 전 조회 2,518
12년 전 조회 2,385
12년 전 조회 2,571
12년 전 조회 4,579
12년 전 조회 2,347
12년 전 조회 3,074
12년 전 조회 2,508
12년 전 조회 2,173
12년 전 조회 2,629
12년 전 조회 3,348
12년 전 조회 2,614
12년 전 조회 2,397
12년 전 조회 2,937
12년 전 조회 1.6만
12년 전 조회 2,212
12년 전 조회 2,033
12년 전 조회 3,819
12년 전 조회 1만
12년 전 조회 2,389
12년 전 조회 2,323
12년 전 조회 2,769
12년 전 조회 2,235
12년 전 조회 2,387
12년 전 조회 4,661
12년 전 조회 2,610
12년 전 조회 3,272
12년 전 조회 2,272
12년 전 조회 2,426
12년 전 조회 4,154
12년 전 조회 2,004
12년 전 조회 2,499
12년 전 조회 2,814
12년 전 조회 3,252
12년 전 조회 3,359
12년 전 조회 3,829
13년 전 조회 2,258
13년 전 조회 2,279
13년 전 조회 5,669
13년 전 조회 2,733
13년 전 조회 2,893
13년 전 조회 6,752
13년 전 조회 4,471
13년 전 조회 3,390
13년 전 조회 2,582
13년 전 조회 4,746
13년 전 조회 3,739
13년 전 조회 3,436
13년 전 조회 3,082
13년 전 조회 2,785
13년 전 조회 2,769
13년 전 조회 2,499
13년 전 조회 3,632
13년 전 조회 2,930
13년 전 조회 2,581
13년 전 조회 3,639
13년 전 조회 2,855
13년 전 조회 3,462
13년 전 조회 4,690
13년 전 조회 2,449
13년 전 조회 3,437
13년 전 조회 2,273
13년 전 조회 2,734
13년 전 조회 3,368
13년 전 조회 3,007
13년 전 조회 5,798
13년 전 조회 3,927
13년 전 조회 4,111
13년 전 조회 2,456
13년 전 조회 9,782
13년 전 조회 4,627
13년 전 조회 2,689
13년 전 조회 2,549
13년 전 조회 3,935
13년 전 조회 6,654
13년 전 조회 4,672
13년 전 조회 2,590
13년 전 조회 1.5만
13년 전 조회 2,466
13년 전 조회 1,889
13년 전 조회 5,142
13년 전 조회 2,635
13년 전 조회 1.1만
13년 전 조회 2,074
13년 전 조회 2,453
13년 전 조회 4,514
13년 전 조회 2,124
13년 전 조회 3,024
13년 전 조회 4,947
13년 전 조회 2,334
13년 전 조회 2,232