flaviovs / yii2-imagefilters
为 Yii2 Imagefilter 扩展提供的图像过滤器
1.0.1
2020-04-06 07:18 UTC
Requires
- flaviovs/yii2-imagefilter: ~1.0
- yiisoft/yii2-imagine: ^2.1
Requires (Dev)
- yiisoft/yii2: ~2.0.0
This package is not auto-updated.
Last update: 2024-09-17 03:52:42 UTC
README
本包为 Yii2 Imagefilter 扩展提供图像过滤器。
目前提供以下过滤器
-
fv\yii\imagefilters\Thumbnail
(width
,height
,mode
) - 为图像创建缩略图。模式为THUMBNAIL_INSET
或THUMBNAIL_OUTBOUND
常量(默认),定义在Imagine\Image\ImageInterface
中。见 https://yiiframework.cn/extension/yiisoft/yii2-imagine/doc/api/2.2/yii-imagine-baseimage#thumbnail()-detail -
fv\yii\imagefilters\Resize
(width
,height
,keepAspectRatio
,allowUpscaling
) - 调整图像大小。见 https://yiiframework.cn/extension/yiisoft/yii2-imagine/doc/api/2.2/yii-imagine-baseimage#resize()-detail
欢迎提供更多过滤器的补丁。
使用方法
将这些过滤器添加到您的 Yii2 Imagefilter 管道中
[ 'class' => \fv\yii\imagefilters\Thumbnail::class, 'width' => 100, 'height' => 100, 'mode' => \Imagine\Image\ImageInterface::THUMBNAIL_INSET, ]