php 给图片加水印

2021-01-16 14:14

阅读:615

标签:func   list   ges   water   function   color   creat   nbsp   图片加水印   

php
    water(‘upload/images/202007250204199.jpg‘, ‘upload/images/202007250155160.jpg‘);
    
    function water($durl, $surl) {
        $dit = imagecreatefromjpeg($durl);
        $src = imagecreatefromjpeg($surl);
        
        list($dw, $dh) = getimagesize($durl);
        list($sw, $sh) = getimagesize($surl);
        
        $result = imagecopymerge($dit, $src, ($dw - $sw) / 2, $dh - $sh - 100, 0, 0, $sw, $sh, 100);
        
        header(‘Content-type:image/jpeg‘);
        imagejpeg($dit, NULL, 100);
        
        imagedestroy($dit);
        imagedestroy($src);
    }
?>

 

php 给图片加水印

标签:func   list   ges   water   function   color   creat   nbsp   图片加水印   

原文地址:https://www.cnblogs.com/qiuxd/p/13376566.html


评论


亲,登录后才可以留言!