定制 php-quickorm/image-resize 二次开发

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

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

php-quickorm/image-resize

Composer 安装命令:

composer require php-quickorm/image-resize

包简介

A library implemented by PHP to resize image and add water mark

README 文档

README

What is it

A library implemented by PHP to resize image smartly and add water mark.

This library will help you resize the image according to the width and height defined and cut smartly to promise the length-to-width ratio, and add water mark in the mean time.

Requirements

  • PHP 5 +
  • PHP GD
  • composer

Please assure that you have installed php-gd, and install it via apt install php7.0-gd or apt install php5-gd is recommended.

Installation

Here are two ways to install:

  • Using composer:

    composer require php-quickorm/image-resize
    
  • or download the ImageResize.php to your project and import it by require "ImageResize.php";

Usage

Resize

// Resize the firework.jpg to 800x600
$a = new ImageResize(realpath('firework.jpg'),800,600);

// Save to firework2.png;
$a->save("firework.png");

// or send as HTTP response
$a->render();

Water Mark

// Resize the firework.jpg to 800x600
$a = new ImageResize(realpath('firework.jpg'),800,600);

/*
* Add text to image
* The font size is 1 - 5 and the position only supports bottom-left, bottom-right, top-left, top-right 
*/

// use font size 5, color #ffffff and place at bottom-right with margin 10px
$a->addTextMark("Author:Rytia", 5, "#ffffff", "right", "bottom",10);
// use font size 4, color #ccccc and place at bottom-left with margin 15px
$a->addTextMark("Blog:www.zzfly.net", 4, "#cccccc", "left", "bottom",15);


/*
* Add water mark to image
* The position only supports bottom-left, bottom-right, top-left, top-right 
*/
$a->addImageMark(realpath('mark.jpg'),100,80,"right","bottom",50);

// Save to firework2.png;
$a->save("firework.png");

// or send as HTTP response
$a->render();

img

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-02-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固