vyalov.alexander/imagedefender
Composer 安装命令:
composer require vyalov.alexander/imagedefender
包简介
Imposition of a protective mask on an image
README 文档
README
ImageDefender is a PHP library for protecting images against copying. It allows to overaly an image (stamp) or text (sign) to your picture, to prevent unlicensed copying of your content.
Installation
Composer
Execute the following command to get the latest version of the package:
composer require vyalov.alexander/imagedefender
Check you php.ini you must see, something like this:
GD Support enabled
GD Version bundled (2.0.28 compatible)
Usage
GD realisation of ImageDefenderInterface
$factory = new \VyalovAlexander\ImageDefender\GD\GDImageDefenderFactory(); //Objects are ready to work $signDefender = $factory->getSignImageDefender(); $stampDefender = $factory->getStampImageDefender();
Stamp
//you can configure your "stamp defender" $stampDefender->setStamp('path/to/stmap/image.png') ->setStampHeight($height) ->setStampWidth($width) ->setStampMarginRight($marginRight) ->setStampMarginBottom($marginBottom) ->setStampTransparency($transparency); $stampDefender->impose('path/to/picture/you/want/to/protect.png', "/save/path/of/resulting/picture.png");
Sign
//you can configure your "sign defender" $signDefender->setFont('path/to/your/TTF/font.ttf') ->setSign($textYouWantToImpose) ->setSignAngle($textAngle) ->setSignColor($red, $green, $blue) ->setSignFontSize($fontSize) ->setSignMarginBottom($marginRight) ->setSignMarginRight($marginRight) ->setSignTransparency($textTransparency); $signDefender->impose('path/to/picture/you/want/to/protect.png', "/save/path/of/resulting/picture.png");
License
The ImageDefender library is open-sourced software licensed under the MIT license.
统计信息
- 总下载量: 25
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-08-03