diff --git a/admin-dev/tabs/AdminCMSCategories.php b/admin-dev/tabs/AdminCMSCategories.php index d19574b55..1d6aa57d6 100644 --- a/admin-dev/tabs/AdminCMSCategories.php +++ b/admin-dev/tabs/AdminCMSCategories.php @@ -29,8 +29,6 @@ include_once(PS_ADMIN_DIR.'/../classes/AdminTab.php'); class AdminCMSCategories extends AdminTab { - protected $maxImageSize = 300000; - /** @var object CMSCategory() instance for navigation*/ private $_CMSCategory; diff --git a/admin-dev/tabs/AdminCarriers.php b/admin-dev/tabs/AdminCarriers.php index c989bec7f..76bbd0745 100644 --- a/admin-dev/tabs/AdminCarriers.php +++ b/admin-dev/tabs/AdminCarriers.php @@ -29,8 +29,6 @@ include_once(PS_ADMIN_DIR.'/../classes/AdminTab.php'); class AdminCarriers extends AdminTab { - protected $maxImageSize = 30000; - public function __construct() { $this->table = 'carrier'; diff --git a/admin-dev/tabs/AdminCategories.php b/admin-dev/tabs/AdminCategories.php index 3ace735f2..69b19409d 100644 --- a/admin-dev/tabs/AdminCategories.php +++ b/admin-dev/tabs/AdminCategories.php @@ -27,8 +27,6 @@ class AdminCategories extends AdminTab { - protected $maxImageSize = 300000; - /** @var object Category() instance for navigation*/ private $_category; diff --git a/admin-dev/tabs/AdminLanguages.php b/admin-dev/tabs/AdminLanguages.php index 8abe35e0e..802704dde 100644 --- a/admin-dev/tabs/AdminLanguages.php +++ b/admin-dev/tabs/AdminLanguages.php @@ -66,7 +66,7 @@ class AdminLanguages extends AdminTab public function copyNoPictureImage($language) { if (isset($_FILES['no-picture']) and $_FILES['no-picture']['error'] === 0) - if ($error = checkImage($_FILES['no-picture'], $this->maxImageSize)) + if ($error = checkImage($_FILES['no-picture'], Tools::getMaxUploadSize())) $this->_errors[] = $error; else { diff --git a/admin-dev/tabs/AdminManufacturers.php b/admin-dev/tabs/AdminManufacturers.php index 1935e4a91..5c899ca8e 100644 --- a/admin-dev/tabs/AdminManufacturers.php +++ b/admin-dev/tabs/AdminManufacturers.php @@ -27,8 +27,6 @@ class AdminManufacturers extends AdminTab { - protected $maxImageSize = 200000; - /** @var array countries list */ private $countriesArray = array(); diff --git a/admin-dev/tabs/AdminProducts.php b/admin-dev/tabs/AdminProducts.php index 2c9c6cdbc..9959991c3 100644 --- a/admin-dev/tabs/AdminProducts.php +++ b/admin-dev/tabs/AdminProducts.php @@ -28,8 +28,7 @@ include_once(PS_ADMIN_DIR.'/tabs/AdminProfiles.php'); class AdminProducts extends AdminTab { - protected $maxImageSize = 2000000; - protected $maxFileSize = 10000000; + protected $maxFileSize = 20000000; private $_category; @@ -1009,12 +1008,6 @@ class AdminProducts extends AdminTab if (!$image->add()) throw new Exception(Tools::displayError('Error while creating additional image')); - if (filesize($subdir.$file) > $this->maxImageSize) - { - $image->delete(); - throw new Exception(Tools::displayError('Image is too large').' ('.(filesize($subdir.$file) / 1000).Tools::displayError('kB').'). '.Tools::displayError('Maximum allowed:').' '.($this->maxImageSize / 1000).Tools::displayError('kB')); - } - $ext = substr($file, -4); $type = (isset($types[$ext]) ? $types[$ext] : ''); if (!isPicture(array('tmp_name' => $subdir.$file, 'type' => $type))) @@ -1063,7 +1056,7 @@ class AdminProducts extends AdminTab { if (!isset($_FILES['image_product']['tmp_name'])) return false; - if ($error = checkImage($_FILES['image_product'], $this->maxImageSize)) + if ($error = checkImage($_FILES['image_product'])) $this->_errors[] = $error; else { @@ -2991,7 +2984,7 @@ class AdminProducts extends AdminTab
- '.$this->l('Format:').' JPG, GIF, PNG. '.$this->l('Filesize:').' '.($this->maxImageSize / 1000).''.$this->l('Kb max.').'
+ '.$this->l('Format:').' JPG, GIF, PNG. '.$this->l('Filesize:').' '.(Tools::getMaxUploadSize() / 1024).''.$this->l('Kb max.').'
'.$this->l('You can also upload a ZIP file containing several images. Thumbnails will be resized automatically.').'
'.$this->l('Format:').' JPG, GIF, PNG. '.$this->l('File size:').' '.($this->maxImageSize / 1000).''.$this->l('KB max.').' '.$this->l('If larger than the image size setting, the image will be reduced to ').' '.$largeSceneImageType['width'].'x'.$largeSceneImageType['height'].'px '.$this->l('(width x height). If smaller than the image-size setting, a white background will be added in order to achieve the correct image size.').'.
'.$this->l('Note: To change image dimensions, please change the \'large_scene\' image type settings to the desired size (in Back Office > Preferences > Images).').'
'.$this->l('Format:').' JPG, GIF, PNG. '.$this->l('File size:').' '.(Tools::getMaxUploadSize() / 1024).''.$this->l('KB max.').' '.$this->l('If larger than the image size setting, the image will be reduced to ').' '.$largeSceneImageType['width'].'x'.$largeSceneImageType['height'].'px '.$this->l('(width x height). If smaller than the image-size setting, a white background will be added in order to achieve the correct image size.').'.
'.$this->l('Note: To change image dimensions, please change the \'large_scene\' image type settings to the desired size (in Back Office > Preferences > Images).').'
'.$this->l('If you want to use a thumbnail other than one generated from simply reducing the mapped image, please upload it here.').'
'.$this->l('Format:').' JPG, GIF, PNG. '.$this->l('Filesize:').' '.($this->maxImageSize / 1000).''.$this->l('Kb max.').' '.$this->l('Automatically resized to').' '.$thumbSceneImageType['width'].'x'.$thumbSceneImageType['height'].'px '.$this->l('(width x height)').'.
'.$this->l('Note: To change image dimensions, please change the \'thumb_scene\' image type settings to the desired size (in Back Office > Preferences > Images).').'
'.$this->l('If you want to use a thumbnail other than one generated from simply reducing the mapped image, please upload it here.').'
'.$this->l('Format:').' JPG, GIF, PNG. '.$this->l('Filesize:').' '.(Tools::getMaxUploadSize() / 1024).''.$this->l('Kb max.').' '.$this->l('Automatically resized to').' '.$thumbSceneImageType['width'].'x'.$thumbSceneImageType['height'].'px '.$this->l('(width x height)').'.
'.$this->l('Note: To change image dimensions, please change the \'thumb_scene\' image type settings to the desired size (in Back Office > Preferences > Images).').'