首页 > 其他 > 详细

为图片添加图片水印

时间:2015-01-28 12:47:43      阅读:172      评论:0      收藏:0      [点我收藏+]
<?php
$srcFile="../images/logo.jpg";
$dstFile="uploads/des_big.jpg";
$srcFileInfo=getimagesize($srcFile);
//print_r( $srcFileInfo);
$src_w=$srcFileInfo[0];
$src_h=$srcFileInfo[1];
$dstFileInfo=getimagesize($dstFile);
$srcMime=$srcFileInfo[‘mime‘];
$dstMime=$dstFileInfo[‘mime‘];
$createSrcFun=str_replace("/","createfrom",$srcMime);
$createDstFun=str_replace("/","createfrom",$dstMime);
$outDstFun=str_replace("/",null,$dstMime);
$dst_im=$createDstFun($dstFile);
$src_im=$createSrcFun($srcFile);
imagecopymerge($dst_im,$src_im,0,0,0,0,$src_w,$src_h,20);
header("content-type:".$dstMime);
$outDstFun($dst_im);
imagedestroy($src_im);
imagedestroy($dst_im);
?>

 

为图片添加图片水印

原文:http://www.cnblogs.com/jacson/p/4255479.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!