flaviovs / yii2-imagefilters
Image filters for the Yii2 Imagefilter extension
Installs: 1 335
Dependents: 0
Suggesters: 1
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:yii2-extension
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-11-12 04:26:56 UTC
README
This package provides image filters for the Yii2 Imagefilter extension.
Currently, the following filter is available:
-
fv\yii\imagefilters\Thumbnail
(width
,height
,mode
) - create a thumbnail for an image. Mode is eitherTHUMBNAIL_INSET
orTHUMBNAIL_OUTBOUND
(default) constants defined inImagine\Image\ImageInterface
. See https://www.yiiframework.com/extension/yiisoft/yii2-imagine/doc/api/2.2/yii-imagine-baseimage#thumbnail()-detail -
fv\yii\imagefilters\Resize
(width
,height
,keepAspectRatio
,allowUpscaling
) - resize na image. See https://www.yiiframework.com/extension/yiisoft/yii2-imagine/doc/api/2.2/yii-imagine-baseimage#resize()-detail
Patches for more filters are welcome.
How to use
Add these filters to your Yii2 Imagefilter pipelines:
[ 'class' => \fv\yii\imagefilters\Thumbnail::class, 'width' => 100, 'height' => 100, 'mode' => \Imagine\Image\ImageInterface::THUMBNAIL_INSET, ]