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,032
12년 전 조회 3,558
12년 전 조회 2,047
12년 전 조회 9,311
12년 전 조회 2,294
12년 전 조회 4,521
12년 전 조회 7,177
12년 전 조회 2,330
12년 전 조회 3,593
12년 전 조회 1,332
12년 전 조회 2,031
12년 전 조회 1,913
12년 전 조회 2,086
12년 전 조회 4,069
12년 전 조회 1,840
12년 전 조회 2,585
12년 전 조회 2,038
12년 전 조회 1,666
12년 전 조회 2,096
12년 전 조회 2,839
12년 전 조회 2,125
12년 전 조회 1,965
12년 전 조회 2,481
12년 전 조회 1.5만
12년 전 조회 1,747
12년 전 조회 1,522
12년 전 조회 3,375
12년 전 조회 9,606
12년 전 조회 1,915
12년 전 조회 1,871
12년 전 조회 2,307
12년 전 조회 1,795
12년 전 조회 1,975
12년 전 조회 4,238
12년 전 조회 2,146
12년 전 조회 2,809
12년 전 조회 1,804
12년 전 조회 1,979
12년 전 조회 3,682
12년 전 조회 1,523
12년 전 조회 2,017
12년 전 조회 2,341
12년 전 조회 2,771
12년 전 조회 2,876
12년 전 조회 3,320
12년 전 조회 1,779
12년 전 조회 1,832
12년 전 조회 5,197
12년 전 조회 2,250
12년 전 조회 2,435
12년 전 조회 6,261
12년 전 조회 3,951
12년 전 조회 2,928
12년 전 조회 2,068
12년 전 조회 4,244
12년 전 조회 3,255
12년 전 조회 2,929
12년 전 조회 2,609
12년 전 조회 2,289
12년 전 조회 2,307
12년 전 조회 2,042
12년 전 조회 3,120
12년 전 조회 2,438
12년 전 조회 2,141
12년 전 조회 3,205
12년 전 조회 2,390
12년 전 조회 2,977
12년 전 조회 4,200
12년 전 조회 1,952
12년 전 조회 2,932
12년 전 조회 1,792
12년 전 조회 2,276
12년 전 조회 2,915
12년 전 조회 2,518
12년 전 조회 5,328
12년 전 조회 3,443
12년 전 조회 3,640
12년 전 조회 2,000
12년 전 조회 9,327
12년 전 조회 4,141
12년 전 조회 2,202
12년 전 조회 2,068
12년 전 조회 3,496
12년 전 조회 6,183
12년 전 조회 4,198
12년 전 조회 2,112
12년 전 조회 1.4만
12년 전 조회 1,988
12년 전 조회 1,419
12년 전 조회 4,785
12년 전 조회 2,263
12년 전 조회 1만
12년 전 조회 1,589
12년 전 조회 2,036
12년 전 조회 4,034
12년 전 조회 1,670
12년 전 조회 2,573
12년 전 조회 4,558
12년 전 조회 1,865
12년 전 조회 1,752