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년 전 조회 1,392
12년 전 조회 2,941
12년 전 조회 1,420
12년 전 조회 8,594
12년 전 조회 1,650
12년 전 조회 3,914
12년 전 조회 6,516
12년 전 조회 1,705
12년 전 조회 2,972
12년 전 조회 739
12년 전 조회 1,439
12년 전 조회 1,299
12년 전 조회 1,447
12년 전 조회 3,452
12년 전 조회 1,225
12년 전 조회 1,960
12년 전 조회 1,395
12년 전 조회 1,050
12년 전 조회 1,532
12년 전 조회 2,247
12년 전 조회 1,530
12년 전 조회 1,420
12년 전 조회 1,941
12년 전 조회 1.5만
12년 전 조회 1,211
12년 전 조회 1,026
12년 전 조회 2,860
12년 전 조회 9,097
12년 전 조회 1,419
12년 전 조회 1,317
12년 전 조회 1,769
12년 전 조회 1,282
12년 전 조회 1,421
12년 전 조회 3,689
12년 전 조회 1,605
12년 전 조회 2,276
12년 전 조회 1,290
12년 전 조회 1,448
12년 전 조회 3,175
12년 전 조회 1,014
12년 전 조회 1,488
12년 전 조회 1,747
12년 전 조회 2,169
12년 전 조회 2,273
12년 전 조회 2,708
12년 전 조회 1,195
12년 전 조회 1,217
12년 전 조회 4,589
12년 전 조회 1,628
12년 전 조회 1,781
12년 전 조회 5,649
12년 전 조회 3,397
12년 전 조회 2,291
12년 전 조회 1,436
12년 전 조회 3,628
12년 전 조회 2,646
12년 전 조회 2,363
12년 전 조회 1,974
12년 전 조회 1,679
12년 전 조회 1,676
12년 전 조회 1,426
12년 전 조회 2,534
12년 전 조회 1,815
12년 전 조회 1,486
12년 전 조회 2,570
12년 전 조회 1,739
12년 전 조회 2,373
12년 전 조회 3,592
12년 전 조회 1,370
12년 전 조회 2,336
12년 전 조회 1,181
12년 전 조회 1,667
12년 전 조회 2,263
12년 전 조회 1,887
12년 전 조회 4,707
12년 전 조회 2,806
12년 전 조회 2,975
12년 전 조회 1,356
12년 전 조회 8,684
12년 전 조회 3,479
12년 전 조회 1,570
12년 전 조회 1,418
12년 전 조회 2,824
12년 전 조회 5,506
12년 전 조회 3,554
12년 전 조회 1,479
12년 전 조회 1.4만
12년 전 조회 1,342
12년 전 조회 748
12년 전 조회 4,071
12년 전 조회 1,580
12년 전 조회 9,482
12년 전 조회 916
12년 전 조회 1,378
12년 전 조회 3,358
12년 전 조회 985
12년 전 조회 1,900
12년 전 조회 3,792
12년 전 조회 1,210
12년 전 조회 1,112
🐛 버그신고