public function getSummaryThumbnail()
    {
        $data = [];

        if ($this->File() && $this->File()->exists()) {
            if ($this->File()->getIsImage()) {
                // Stretch to maximum of 36px either way then trim the extra off
                if ($this->File()->getOrientation() === Image_Backend::ORIENTATION_PORTRAIT) {
                    $data['Image'] = $this->File()->ScaleWidth(36)->CropHeight(36);
                } else {
                    $data['Image'] = $this->File()->ScaleHeight(36)->CropWidth(36);
                }
            } else {
                $data = [
                    'Image' => ModuleResourceLoader::resourceURL(
                        'silverstripe/framework:client/images/app_icons/document_92.png'
                    ),
                    'IsPlaceholder' => true
                ];
            }
        }

        return $this->customise($data)->renderWith(__CLASS__ . '/SummaryThumbnail');
    }
public function getSummaryThumbnail()
    {
        $data = [];

        if ($this->File() && $this->File()->exists()) {
            if ($this->File()->getIsImage()) {
                // Stretch to maximum of 36px either way then trim the extra off
                if ($this->File()->getOrientation() === Image_Backend::ORIENTATION_PORTRAIT) {
                    $data['Image'] = $this->File()->ScaleWidth(36)->CropHeight(36);
                } else {
                    $data['Image'] = $this->File()->ScaleHeight(36)->CropWidth(36);
                }
            } else {
                $data = [
                    'Image' => ModuleResourceLoader::resourceURL(
                        'silverstripe/framework:client/images/app_icons/document_92.png'
                    ),
                    'IsPlaceholder' => true
                ];
            }
        }

        return $this->customise($data)->renderWith(__CLASS__ . '/SummaryThumbnail');
    }
public function getSummaryThumbnail ( ) { $ data = [ ] ; if ( $ this -> File ( ) && $ this -> File ( ) -> exists ( ) ) { if ( $ this -> File ( ) -> getIsImage ( ) ) { // Stretch to maximum of 36px either way then trim the extra off if ( $ this -> File ( ) -> getOrientation ( ) === Image_Backend :: ORIENTATION_PORTRAIT ) { $ data [ 'Image' ] = $ this -> File ( ) -> ScaleWidth ( 36 ) -> CropHeight ( 36 ) ; } else { $ data [ 'Image' ] = $ this -> File ( ) -> ScaleHeight ( 36 ) -> CropWidth ( 36 ) ; } } else { $ data = [ 'Image' => ModuleResourceLoader :: resourceURL ( 'silverstripe/framework:client/images/app_icons/document_92.png' ) , 'IsPlaceholder' => true ] ; } } return $ this -> customise ( $ data ) -> renderWith ( __CLASS__ . '/SummaryThumbnail' ) ; }
Return a thumbnail of the file, if it's an image. Used in GridField preview summaries.

@return DBHTMLText
Return a thumbnail of the file if it s an image . Used in GridField preview summaries .