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,534
12년 전 조회 3,089
12년 전 조회 1,554
12년 전 조회 8,742
12년 전 조회 1,806
12년 전 조회 4,050
12년 전 조회 6,681
12년 전 조회 1,855
12년 전 조회 3,135
12년 전 조회 886
12년 전 조회 1,571
12년 전 조회 1,426
12년 전 조회 1,588
12년 전 조회 3,582
12년 전 조회 1,373
12년 전 조회 2,090
12년 전 조회 1,541
12년 전 조회 1,197
12년 전 조회 1,670
12년 전 조회 2,396
12년 전 조회 1,661
12년 전 조회 1,570
12년 전 조회 2,080
12년 전 조회 1.5만
12년 전 조회 1,344
12년 전 조회 1,157
12년 전 조회 2,994
12년 전 조회 9,234
12년 전 조회 1,537
12년 전 조회 1,466
12년 전 조회 1,913
12년 전 조회 1,415
12년 전 조회 1,561
12년 전 조회 3,850
12년 전 조회 1,745
12년 전 조회 2,411
12년 전 조회 1,445
12년 전 조회 1,587
12년 전 조회 3,299
12년 전 조회 1,154
12년 전 조회 1,609
12년 전 조회 1,883
12년 전 조회 2,306
12년 전 조회 2,425
12년 전 조회 2,851
12년 전 조회 1,316
12년 전 조회 1,334
12년 전 조회 4,737
12년 전 조회 1,770
12년 전 조회 1,918
12년 전 조회 5,771
12년 전 조회 3,512
12년 전 조회 2,420
12년 전 조회 1,572
12년 전 조회 3,760
12년 전 조회 2,784
12년 전 조회 2,487
12년 전 조회 2,126
12년 전 조회 1,809
12년 전 조회 1,807
12년 전 조회 1,565
12년 전 조회 2,685
12년 전 조회 1,959
12년 전 조회 1,639
12년 전 조회 2,718
12년 전 조회 1,900
12년 전 조회 2,521
12년 전 조회 3,731
12년 전 조회 1,517
12년 전 조회 2,475
12년 전 조회 1,330
12년 전 조회 1,820
12년 전 조회 2,398
12년 전 조회 2,022
12년 전 조회 4,835
12년 전 조회 2,943
12년 전 조회 3,117
12년 전 조회 1,480
12년 전 조회 8,801
12년 전 조회 3,630
12년 전 조회 1,714
12년 전 조회 1,579
12년 전 조회 2,969
12년 전 조회 5,643
12년 전 조회 3,687
12년 전 조회 1,640
12년 전 조회 1.4만
12년 전 조회 1,498
12년 전 조회 894
12년 전 조회 4,204
12년 전 조회 1,715
12년 전 조회 9,593
12년 전 조회 1,077
12년 전 조회 1,516
12년 전 조회 3,482
12년 전 조회 1,129
12년 전 조회 2,031
12년 전 조회 3,938
12년 전 조회 1,344
12년 전 조회 1,246