From ee07891856294ce1e06bfc98a3787d1ddbdb3961 Mon Sep 17 00:00:00 2001 From: Alexander Demidov Date: Fri, 27 May 2016 15:26:42 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9C=D0=B5=D1=82=D0=BE=D0=B4=20getThumb=20?= =?UTF-8?q?=D0=B4=D0=BB=D1=8F=20=D1=83=D0=BF=D1=80=D0=BE=D1=89=D0=B5=D0=BD?= =?UTF-8?q?=D0=BD=D0=BE=D0=B3=D0=BE=20=D0=B4=D0=BE=D1=81=D1=82=D1=83=D0=BF?= =?UTF-8?q?=D0=B0=20=D0=BA=20=D1=81=D0=BE=D1=80=D1=86=D0=B0=D0=BC=20=D1=84?= =?UTF-8?q?=D0=BE=D1=82=D0=BE=D0=BA=20=D0=B2=20=D1=88=D0=B0=D0=B1=D0=BB?= =?UTF-8?q?=D0=BE=D0=BD=D0=B8=D0=B7=D0=B0=D1=82=D0=BE=D1=80=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Image.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Image.php b/Image.php index 33bfd26..28bf08f 100644 --- a/Image.php +++ b/Image.php @@ -91,4 +91,11 @@ abstract class Image extends File return parent::getImageVariant($size, $force_create, $important_create); } + + public function getThumb($width = 0, $height = 0, $crop_method = null) { + if ( $width == 0 && $height == 0 ) { + return \Majestic\Config::get('static_url') . $this->getWebName(); + } + return \Majestic\Config::get('static_url') . $this->getVariant($width . 'x' . $height)->getWebName(); + } } \ No newline at end of file