public function createDefaultThumb(array $routes)
    {
        $originalFile = pathinfo($this->url);
        $dirname = $originalFile['dirname'];
        $filename = $originalFile['filename'];
        $extension = $originalFile['extension'];

        Image::$driver = [Image::DRIVER_GD2, Image::DRIVER_GMAGICK, Image::DRIVER_IMAGICK];

        $size = Module::getDefaultThumbSize();
        $width = $size[0];
        $height = $size[1];
        $thumbUrl = "$dirname/" . $this->getThumbFilename($filename, $extension, Module::DEFAULT_THUMB_ALIAS, $width, $height);
        $basePath = Yii::getAlias($routes['basePath']);
        Image::thumbnail("$basePath/{$this->url}", $width, $height)->save("$basePath/$thumbUrl");
    }
public function createDefaultThumb(array $routes)
    {
        $originalFile = pathinfo($this->url);
        $dirname = $originalFile['dirname'];
        $filename = $originalFile['filename'];
        $extension = $originalFile['extension'];

        Image::$driver = [Image::DRIVER_GD2, Image::DRIVER_GMAGICK, Image::DRIVER_IMAGICK];

        $size = Module::getDefaultThumbSize();
        $width = $size[0];
        $height = $size[1];
        $thumbUrl = "$dirname/" . $this->getThumbFilename($filename, $extension, Module::DEFAULT_THUMB_ALIAS, $width, $height);
        $basePath = Yii::getAlias($routes['basePath']);
        Image::thumbnail("$basePath/{$this->url}", $width, $height)->save("$basePath/$thumbUrl");
    }
public function createDefaultThumb ( array $ routes ) { $ originalFile = pathinfo ( $ this -> url ) ; $ dirname = $ originalFile [ 'dirname' ] ; $ filename = $ originalFile [ 'filename' ] ; $ extension = $ originalFile [ 'extension' ] ; Image :: $ driver = [ Image :: DRIVER_GD2 , Image :: DRIVER_GMAGICK , Image :: DRIVER_IMAGICK ] ; $ size = Module :: getDefaultThumbSize ( ) ; $ width = $ size [ 0 ] ; $ height = $ size [ 1 ] ; $ thumbUrl = "$dirname/" . $ this -> getThumbFilename ( $ filename , $ extension , Module :: DEFAULT_THUMB_ALIAS , $ width , $ height ) ; $ basePath = Yii :: getAlias ( $ routes [ 'basePath' ] ) ; Image :: thumbnail ( "$basePath/{$this->url}" , $ width , $ height ) -> save ( "$basePath/$thumbUrl" ) ; }
Create default thumbnail

@param array $routes see routes in module config
Create default thumbnail