2017 © Pedro Peláez
 

yii2-extension yii2-thumbnail

Create thumnails ad-hoc

image

ipoz/yii2-thumbnail

Create thumnails ad-hoc

  • Sunday, April 23, 2017
  • by ipoz
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Generate image thumbnail ad-hoc for Yii2 project

Installation

To install, either run, (*1)

composer require ipoz/yii2-thumbnail

or add to the required section of your composer.json file, (*2)

"ipoz/yii2-thumbnail": "*" 

Configuration app

'components' =>
[
    'thumbnail' => [
        'class' => 'ipoz\yii2\thumbnail\Thumbnail',
        'repositoryDir' => PATH_TO_YOUR_REPOSITORY
    ]

]

Example usage

use ipoz\yii2\thumbnail\Image;

...

public function actionThumbnail($image, $width, $height = 0, $type = '')
    {
        $imagePath = \Yii::$app->thumbnail->generateThumbnail($image, $width, $height, $type);
        return \Yii::$app->response->sendFile($imagePath, $image, [
            'mimeType' => Image::getMimeType($imagePath),
            'inline' => true,
        ]);
    }

The Versions

23/04 2017

dev-master

9999999-dev

Create thumnails ad-hoc

  Sources   Download

BSD 3-Clause

The Requires

 

by Rafał Ciszewski

extension yii2 widget thumnails