scanerrr / yii2-local-image
Resize images and save to cache.
Installs: 29
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- php: >=7.0
- ext-exif: *
- ext-gd: *
- yiisoft/yii2: *
This package is auto-updated.
Last update: 2025-06-24 08:52:16 UTC
README
Simple Yii2 extension for resizing images and saving them to cache
Installation
Add yii2-local-image to the require section of your composer.json file:
{ "require": { "scanerrr/yii2-local-image": "dev-master" } }
Or simply run
php composer.phar require "scanerrr/yii2-local-image @dev"
Usage
Html::img(Image::resize($pathToImage, $width, $height = null));
Resize image with saving aspect ratio, simply miss "height"
Html::img(Image::resize($pathToImage, 120)) /* * Original image with resolution 1920x1080 * Result image gonna be 120x67 */
TODO
- Add CHANGELOG.md [ ]
- Implement crop function [ ]
- Allow to disable caching [ ]
- Add tests [ ]
- Add comments [ x ]
- Add more extensions [ ]
- Try to rewrite with Imagick [ ]