77
88namespace Magento \Backend \Block \Media ;
99
10+ use Magento \Framework \Image \Adapter \ConfigInterface ;
11+
1012/**
1113 * Adminhtml media library uploader
1214 * @api
@@ -30,25 +32,26 @@ class Uploader extends \Magento\Backend\Block\Widget
3032 protected $ _fileSizeService ;
3133
3234 /**
33- * @var \Magento\Framework\Image\Adapter\ ConfigInterface
35+ * @var ConfigInterface
3436 */
35- protected $ imageConfig ;
37+ private $ imageConfig ;
3638
3739 /**
3840 * @param \Magento\Backend\Block\Template\Context $context
3941 * @param \Magento\Framework\File\Size $fileSize
40- * @param \Magento\Framework\Image\Adapter\ ConfigInterface $imageConfig
42+ * @param ConfigInterface $imageConfig
4143 * @param array $data
4244 */
4345 public function __construct (
4446 \Magento \Backend \Block \Template \Context $ context ,
4547 \Magento \Framework \File \Size $ fileSize ,
46- \ Magento \ Framework \ Image \ Adapter \ ConfigInterface $ imageConfig ,
48+ ConfigInterface $ imageConfig ,
4749 array $ data = []
4850 ) {
51+ parent ::__construct ($ context , $ data );
52+
4953 $ this ->_fileSizeService = $ fileSize ;
5054 $ this ->imageConfig = $ imageConfig ;
51- parent ::__construct ($ context , $ data );
5255 }
5356
5457 /**
@@ -90,13 +93,23 @@ public function getFileSizeService()
9093 }
9194
9295 /**
93- * Get image config
96+ * Get Image Upload Maximum Width Config
97+ *
98+ * @return int
99+ */
100+ public function getUploadImageMaxWidth ()
101+ {
102+ return $ this ->imageConfig ->getMaxWidth ();
103+ }
104+
105+ /**
106+ * Get Image Upload Maximum Height Config
94107 *
95- * @return \Magento\Framework\Image\Adapter\ConfigInterface
108+ * @return int
96109 */
97- public function getImageConfigService ()
110+ public function getUploadImageMaxHeight ()
98111 {
99- return $ this ->imageConfig ;
112+ return $ this ->imageConfig -> getMaxHeight () ;
100113 }
101114
102115 /**
0 commit comments