From 0d68547e57a381671cb5a048c2b28a90f847ad92 Mon Sep 17 00:00:00 2001
From: Nicolas BEJEAN <nicolas.bejean@api-and-you.com>
Date: Sun, 2 Dec 2018 16:45:47 +0100
Subject: [PATCH] =?UTF-8?q?Gestion=20de=20la=20taille=20par=20d=C3=A9faut?=
 =?UTF-8?q?=20des=20images?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 Block/Widget/CategoryWidget.php | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/Block/Widget/CategoryWidget.php b/Block/Widget/CategoryWidget.php
index ed905f9..49d7c3a 100755
--- a/Block/Widget/CategoryWidget.php
+++ b/Block/Widget/CategoryWidget.php
@@ -150,17 +150,25 @@ class CategoryWidget extends \Magento\Framework\View\Element\Template implements
                 if ($isRelativeUrl) :
                     $image = ltrim($image, '/media/');
                 else :
-                    $image = 'catalog/category/'.$image;
+                    $image = 'catalog/category/' . $image;
                 endif;
             endif;
         endif;
 
-        if(is_null($width)) :
-            $width = $this->getCategoryImageWidth();
+        if (is_null($width)) :
+            if (is_null($this->getCategoryImageWidth())) :
+                $width = 450;
+            else:
+                $width = $this->getCategoryImageWidth();
+            endif;
         endif;
 
         if(is_null($height)):
-            $height = $this->getCategoryImageHeight();
+            if (is_null($this->getCategoryImageHeight())) :
+                $height = 450;
+            else:
+                $height = $this->getCategoryImageHeight();
+            endif;
         endif;
 
         $absolutePath = $this->_filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem\DirectoryList::MEDIA)->getAbsolutePath('').$image;
-- 
GitLab