定制 freshleafmedia/glide-dimension-watermark 二次开发

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

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

freshleafmedia/glide-dimension-watermark

最新稳定版本:1.0.0

Composer 安装命令:

composer require freshleafmedia/glide-dimension-watermark

包简介

A Glide manipulation which overlays the images dimensions onto an image.

README 文档

README

Automatically add text to an image showing the dimensions.

Overview

It is common when using placeholder images to show the images dimensions in the center of the image. This library is a Glide manipulator which will do this and automatically adjust text size.

500x300 100x200

Photo by Robert Bye on Unsplash

Installation

composer require freshleafmedia/glide-dimension-watermark

Usage

use Freshleafmedia\DimensionWatermark\DimensionWatermark;

// Setup Glide server. See https://glide.thephpleague.com/2.0/simple-example/
$server = League\Glide\ServerFactory::create([
    // ...
]);


// Add DimensionWatermark to the manipulators array
$manipulators = $server->getApi()->getManipulators();

array_splice($manipulators, count($manipulators) - 1, 0, [new DimensionWatermark()]);

$server->getApi()->setManipulators($manipulators);

The manipulator runs when the dwm parameter is set to any value. For example /image.jpg?dwm=1 or /image.jpg?w=100&fm=webp&dwm=1

Note: It is important that DimensionWatermark is added after the Size manipulator and before Encode manipulator

License

See LICENSE

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-11-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固