2017 © Pedro Peláez
 

yii2-extension yii2-image-resize

A Yii2 component for resizing images (and cache it)

image

fgh151/yii2-image-resize

A Yii2 component for resizing images (and cache it)

  • Thursday, February 9, 2017
  • by fgh151
  • Repository
  • 1 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Image resize for Yii2

A Yii2 component for resizing images and store it in a cache folder, (*1)

Installation

The preferred way to install this extension is through composer., (*2)

  • Either run
php composer require "fgh151/yii2-image-resize" "*"

or add, (*3)

"fgh151/yii2-image-resize" : "*"

to the require section of your application's composer.json file., (*4)

  • Add a new component in components section of your application's configuration file, for example:
'components' => [
    'imageresize' => [
        'class' => 'fgh151\imageresize\ImageResize',
        //path web root 
        'cachePath' => '@frontend/web',
        //path where to store thumbs
        'cacheFolder' => 'upload/thumb',
        //use filename (seo friendly) for resized images else use a hash
        'useFilename' => true,
        //show full url (for example in case of a API)
        'absoluteUrl' => false,
    ],
],

Usage

If you want to get a image url:, (*5)

/*
 * $sImageFilePath_id: (required) path to file
 * $width/$height: (required) width height of the image
 * $mode: "outbound" or "inset" 
 * $$quality: (1 - 100)
 * $chosenFileName: if config -> components -> imageresize -> useFilename is true? its an option to give a custom name else use original file name
 */
\Yii::$app->imageresize->getUrl($imageFile, $width, $height, $mode, $quality, $chosenFileName);

The Versions

09/02 2017

dev-master

9999999-dev https://github.com/fgh151/yii2-image-resize

A Yii2 component for resizing images (and cache it)

  Sources   Download

MIT

The Requires

 

component cache extension yii2 image resize

09/02 2017

v0.0.1

0.0.1.0 https://github.com/fgh151/yii2-image-resize

A Yii2 component for resizing images (and cache it)

  Sources   Download

MIT

The Requires

 

component cache extension yii2 image resize