Home PHP Libraries Picture library PHP class to add watermark to images
PHP class to add watermark to images Share a php class that adds watermarks to images, supports watermark images, Calling method:
Include class files first
Then instantiate the class:
$img = new Images;
Then provide the picture:
$img->imgpath(original image path and name, watermark image path and name);
Start adding watermark after:
$img->send();
illustrate:
send( strimg filename ) This method has a function that can be omitted. In the case of omission, the path and name of the saved image will be the same as the original one. If you need to save it as an exception image, provide the image to be saved here. Path and name
Exception, there is another method, show(); This method is used to display watermarked pictures
This method can be called individually, but the send() method must be called first, or it can be called continuously: $img->send()->show();
Disclaimer

All resources on this site are contributed by netizens or reprinted by major download sites. Please check the integrity of the software yourself! All resources on this site are for learning reference only. Please do not use them for commercial purposes. Otherwise, you will be responsible for all consequences! If there is any infringement, please contact us to delete it. Contact information: admin@php.cn

Related Article

Add watermark to images uploaded to Baidu UEDITOR editor_html/css_WEB-ITnose Add watermark to images uploaded to Baidu UEDITOR editor_html/css_WEB-ITnose

24 Jun 2016

Add watermarks to pictures uploaded to Baidu UEDITOR editor

How to add watermark to pictures in PHP, _PHP tutorial How to add watermark to pictures in PHP, _PHP tutorial

12 Jul 2016

How to add watermark to images in PHP. Implementation method of adding watermark to PHP images. This article describes the implementation method of adding watermark to PHP images. Share it with everyone for your reference, the details are as follows: phpecho img_water_mark("2008112023204423477

How to output multiple sizes of images in php How to output multiple sizes of images in php

06 Jul 2016

{Code...} The picture above is a picture with a width of 480 and a height of 270. Remove the suffix !w480h270 to access the original picture. Question: 1. How is this kind of picture usually stored on the server? Is it just the original picture? 2. Add the suffix !w480h270 to generate corresponding thumbnails. How thumbnails are generally stored...

How to Add Watermarks to Images Using PHP? How to Add Watermarks to Images Using PHP?

18 Oct 2024

How to Watermark Images Using PHPProblem:Users need to upload images to a website and have a watermark (logo) added to them. The watermark should be placed prominently, such as in a corner where it will be visible.Solution:To add a watermark to image

PHP uses the Mysqli class library to achieve perfect paging effect, mysqli class library_PHP tutorial PHP uses the Mysqli class library to achieve perfect paging effect, mysqli class library_PHP tutorial

12 Jul 2016

PHP uses the Mysqli class library to achieve perfect paging effects, the mysqli class library. How PHP uses the Mysqli class library to achieve perfect paging effects, mysqli class library This article describes how PHP uses the Mysqli class library to achieve perfect paging effects. Share it with everyone for your reference.

How to Redefine Class Methods in PHP Without Inheritance? How to Redefine Class Methods in PHP Without Inheritance?

10 Nov 2024

Redefining Class Methods Without InheritanceYou want to redefine a method in a third-party library without modifying the library itself. This can...

See all articles