src/models/StorageFile.php
public function getCreateThumbnail()
    {
        if (!$this->isImage) {
            return false;
        }

        $tinyCrop = Yii::$app->storage->getFilterId(TinyCrop::identifier());
        foreach ($this->images as $image) {
            if ($image->filter_id == $tinyCrop) {
                return ['source' => $image->source];
            }
        }

        // create the thumbnail on the fly if not existing
        $image = Yii::$app->storage->createImage($this->id, $tinyCrop);
        if ($image) {
            return ['source' => $image->source];
        }
    }
public function getCreateThumbnail()
    {
        if (!$this->isImage) {
            return false;
        }

        $tinyCrop = Yii::$app->storage->getFilterId(TinyCrop::identifier());
        foreach ($this->images as $image) {
            if ($image->filter_id == $tinyCrop) {
                return ['source' => $image->source];
            }
        }

        // create the thumbnail on the fly if not existing
        $image = Yii::$app->storage->createImage($this->id, $tinyCrop);
        if ($image) {
            return ['source' => $image->source];
        }
    }
public function getCreateThumbnail ( ) { if ( ! $ this -> isImage ) { return false ; } $ tinyCrop = Yii :: $ app -> storage -> getFilterId ( TinyCrop :: identifier ( ) ) ; foreach ( $ this -> images as $ image ) { if ( $ image -> filter_id == $ tinyCrop ) { return [ 'source' => $ image -> source ] ; } } // create the thumbnail on the fly if not existing $ image = Yii :: $ app -> storage -> createImage ( $ this -> id , $ tinyCrop ) ; if ( $ image ) { return [ 'source' => $ image -> source ] ; } }
Create the thumbnail for this given file if its an image.

> This method is used internal when uploading a file which is an image, the file manager preview images are created here.

@return array Returns an array with the key source which contains the source to the thumbnail.
@since 1.2.2.1
Create the thumbnail for this given file if its an image .