Skip to content

Scanerrr/yii2-local-image

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yii2-local-image

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 [ ]

About

Resize images and save to cache

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages