gdaws/imageresizer
Composer 安装命令:
composer require gdaws/imageresizer
包简介
High-level image resizing library
README 文档
README
High level image resizing library for PHP 5.3+
Usage example:
use Gdaws\ImageResizer\ResizerFacade; use Gdaws\ImageResizer\Exception\ImageResizerException; $resizer = new ResizerFacade(); try { $resizer->resize('in.jpg', 'out.jpg', array( "mode" => "crop", "width" => 100, "height" => 100, "quality" => 80 )); } catch(ImageResizerException $exception) { echo $exception->getMessage(); }
Crop Mode
Scale and then crop the image.
Max Mode
Scale the image to tightly fit the output dimensions while preserving the aspect ratio.
Stretch Mode
Resize the image exactly to the dimensions specified.
Common Settings
These are common settings that affect the output image:
widthof image in pixels. The value must be greater than 0.heightof image in pixels. The value must be greater than 0.qualitysets the compression level. Accepts a value between 0 and 100.
It's possible to only specify one of the dimensions and let the resizer calculate the other dimension using the source image's aspect ratio.
统计信息
- 总下载量: 114
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-02-20