定制 vyalov.alexander/imagedefender 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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");

Stamp

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");

Text

License

The ImageDefender library is open-sourced software licensed under the MIT license.

统计信息

  • 总下载量: 25
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-08-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固