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.
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
其他信息
- 授权协议: MIT
- 更新时间: 2022-11-27

