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,764
12년 전 조회 4,314
12년 전 조회 2,766
12년 전 조회 9,799
12년 전 조회 3,068
12년 전 조회 5,264
12년 전 조회 7,910
12년 전 조회 3,076
12년 전 조회 4,360
12년 전 조회 2,082
12년 전 조회 2,764
12년 전 조회 2,619
12년 전 조회 2,817
12년 전 조회 4,807
12년 전 조회 2,595
12년 전 조회 3,306
12년 전 조회 2,725
12년 전 조회 2,427
12년 전 조회 2,865
12년 전 조회 3,614
13년 전 조회 2,821
13년 전 조회 2,631
13년 전 조회 3,200
13년 전 조회 1.6만
13년 전 조회 2,451
13년 전 조회 2,249
13년 전 조회 4,063
13년 전 조회 1만
13년 전 조회 2,630
13년 전 조회 2,580
13년 전 조회 3,023
13년 전 조회 2,472
13년 전 조회 2,633
13년 전 조회 4,912
13년 전 조회 2,863
13년 전 조회 3,516
13년 전 조회 2,501
13년 전 조회 2,678
13년 전 조회 4,412
13년 전 조회 2,249
13년 전 조회 2,744
13년 전 조회 3,057
13년 전 조회 3,490
13년 전 조회 3,601
13년 전 조회 4,055
13년 전 조회 2,499
13년 전 조회 2,521
13년 전 조회 5,918
13년 전 조회 2,961
13년 전 조회 3,129
13년 전 조회 7,003
13년 전 조회 4,689
13년 전 조회 3,635
13년 전 조회 2,807
13년 전 조회 4,985
13년 전 조회 3,997
13년 전 조회 3,674
13년 전 조회 3,356
13년 전 조회 3,029
13년 전 조회 3,001
13년 전 조회 2,765
13년 전 조회 3,894
13년 전 조회 3,204
13년 전 조회 2,823
13년 전 조회 3,912
13년 전 조회 3,113
13년 전 조회 3,716
13년 전 조회 4,934
13년 전 조회 2,698
13년 전 조회 3,659
13년 전 조회 2,496
13년 전 조회 2,989
13년 전 조회 3,598
13년 전 조회 3,255
13년 전 조회 6,054
13년 전 조회 4,168
13년 전 조회 4,341
13년 전 조회 2,721
13년 전 조회 1만
13년 전 조회 4,853
13년 전 조회 2,927
13년 전 조회 2,806
13년 전 조회 4,194
13년 전 조회 6,918
13년 전 조회 4,914
13년 전 조회 2,837
13년 전 조회 1.5만
13년 전 조회 2,718
13년 전 조회 2,145
13년 전 조회 5,247
13년 전 조회 2,724
13년 전 조회 1.1만
13년 전 조회 2,329
13년 전 조회 2,566
13년 전 조회 4,769
13년 전 조회 2,373
13년 전 조회 3,284
13년 전 조회 5,200
13년 전 조회 2,569
13년 전 조회 2,476