COMING SOON 🚀

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,516
12년 전 조회 4,027
12년 전 조회 2,509
12년 전 조회 9,695
12년 전 조회 2,783
12년 전 조회 5,008
12년 전 조회 7,611
12년 전 조회 2,793
12년 전 조회 4,089
12년 전 조회 1,788
12년 전 조회 2,476
12년 전 조회 2,356
12년 전 조회 2,540
12년 전 조회 4,539
12년 전 조회 2,309
12년 전 조회 3,039
12년 전 조회 2,464
12년 전 조회 2,138
12년 전 조회 2,595
12년 전 조회 3,304
12년 전 조회 2,570
12년 전 조회 2,369
12년 전 조회 2,903
12년 전 조회 1.6만
12년 전 조회 2,179
12년 전 조회 1,986
12년 전 조회 3,782
12년 전 조회 1만
12년 전 조회 2,344
12년 전 조회 2,291
12년 전 조회 2,734
12년 전 조회 2,206
12년 전 조회 2,351
12년 전 조회 4,626
12년 전 조회 2,578
12년 전 조회 3,233
12년 전 조회 2,236
12년 전 조회 2,394
12년 전 조회 4,120
12년 전 조회 1,963
12년 전 조회 2,457
12년 전 조회 2,776
12년 전 조회 3,213
12년 전 조회 3,319
12년 전 조회 3,795
12년 전 조회 2,229
12년 전 조회 2,250
12년 전 조회 5,633
12년 전 조회 2,698
12년 전 조회 2,868
13년 전 조회 6,721
13년 전 조회 4,434
13년 전 조회 3,356
13년 전 조회 2,542
13년 전 조회 4,710
13년 전 조회 3,704
13년 전 조회 3,403
13년 전 조회 3,051
13년 전 조회 2,754
13년 전 조회 2,737
13년 전 조회 2,475
13년 전 조회 3,598
13년 전 조회 2,900
13년 전 조회 2,559
13년 전 조회 3,615
13년 전 조회 2,822
13년 전 조회 3,422
13년 전 조회 4,654
13년 전 조회 2,426
13년 전 조회 3,409
13년 전 조회 2,239
13년 전 조회 2,701
13년 전 조회 3,335
13년 전 조회 2,972
13년 전 조회 5,758
13년 전 조회 3,896
13년 전 조회 4,082
13년 전 조회 2,429
13년 전 조회 9,747
13년 전 조회 4,598
13년 전 조회 2,649
13년 전 조회 2,518
13년 전 조회 3,899
13년 전 조회 6,630
13년 전 조회 4,635
13년 전 조회 2,551
13년 전 조회 1.5만
13년 전 조회 2,439
13년 전 조회 1,862
13년 전 조회 5,142
13년 전 조회 2,635
13년 전 조회 1.1만
13년 전 조회 2,035
13년 전 조회 2,451
13년 전 조회 4,490
13년 전 조회 2,078
13년 전 조회 2,983
13년 전 조회 4,923
13년 전 조회 2,300
13년 전 조회 2,202