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,467
12년 전 조회 3,976
12년 전 조회 2,479
12년 전 조회 9,661
12년 전 조회 2,743
12년 전 조회 4,962
12년 전 조회 7,567
12년 전 조회 2,748
12년 전 조회 4,043
12년 전 조회 1,749
12년 전 조회 2,432
12년 전 조회 2,310
12년 전 조회 2,485
12년 전 조회 4,490
12년 전 조회 2,268
12년 전 조회 3,002
12년 전 조회 2,427
12년 전 조회 2,107
12년 전 조회 2,539
12년 전 조회 3,252
12년 전 조회 2,521
12년 전 조회 2,328
12년 전 조회 2,851
12년 전 조회 1.6만
12년 전 조회 2,131
12년 전 조회 1,942
12년 전 조회 3,746
12년 전 조회 1만
12년 전 조회 2,301
12년 전 조회 2,252
12년 전 조회 2,698
12년 전 조회 2,170
12년 전 조회 2,317
12년 전 조회 4,580
12년 전 조회 2,528
12년 전 조회 3,193
12년 전 조회 2,189
12년 전 조회 2,353
12년 전 조회 4,077
12년 전 조회 1,919
12년 전 조회 2,413
12년 전 조회 2,732
12년 전 조회 3,177
12년 전 조회 3,275
12년 전 조회 3,749
12년 전 조회 2,180
12년 전 조회 2,214
12년 전 조회 5,595
12년 전 조회 2,648
12년 전 조회 2,828
12년 전 조회 6,672
12년 전 조회 4,397
12년 전 조회 3,315
13년 전 조회 2,502
13년 전 조회 4,672
13년 전 조회 3,667
13년 전 조회 3,367
13년 전 조회 3,012
13년 전 조회 2,705
13년 전 조회 2,709
13년 전 조회 2,443
13년 전 조회 3,550
13년 전 조회 2,856
13년 전 조회 2,515
13년 전 조회 3,578
13년 전 조회 2,786
13년 전 조회 3,383
13년 전 조회 4,608
13년 전 조회 2,380
13년 전 조회 3,375
13년 전 조회 2,194
13년 전 조회 2,666
13년 전 조회 3,293
13년 전 조회 2,936
13년 전 조회 5,725
13년 전 조회 3,850
13년 전 조회 4,044
13년 전 조회 2,385
13년 전 조회 9,703
13년 전 조회 4,552
13년 전 조회 2,601
13년 전 조회 2,470
13년 전 조회 3,866
13년 전 조회 6,586
13년 전 조회 4,595
13년 전 조회 2,517
13년 전 조회 1.5만
13년 전 조회 2,397
13년 전 조회 1,810
13년 전 조회 5,104
13년 전 조회 2,605
13년 전 조회 1만
13년 전 조회 1,992
13년 전 조회 2,418
13년 전 조회 4,447
13년 전 조회 2,048
13년 전 조회 2,947
13년 전 조회 4,890
13년 전 조회 2,258
13년 전 조회 2,171