Image filters for the FYii Imagefilter extension
This package provides image filters for the FYii Imagefilter extension.
Currently, the following filter is available:
-
fyii\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 -
fyii\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 FYii Imagefilter pipelines:
[
'class' => 'flaviovs\imagefilters\Thumbnail',
'width' => 100,
'height' => 100,
'mode' => \Imagine\Image\ImageInterface::THUMBNAIL_INSET,
]