[*] BO : Gender - Allow image resizing

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8736 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
mDeflotte
2011-09-23 13:04:52 +00:00
parent a127911a7f
commit 118338a5ea
3 changed files with 49 additions and 7 deletions
+2 -2
View File
@@ -1037,7 +1037,7 @@ abstract class AdminTabCore
return true;
}
protected function uploadImage($id, $name, $dir, $ext = false)
protected function uploadImage($id, $name, $dir, $ext = false, $width = NULL, $height = NULL)
{
if (isset($_FILES[$name]['tmp_name']) AND !empty($_FILES[$name]['tmp_name']))
{
@@ -1058,7 +1058,7 @@ abstract class AdminTabCore
{
$_FILES[$name]['tmp_name'] = $tmpName;
// Copy new image
if (!imageResize($tmpName, _PS_IMG_DIR_.$dir.$id.'.'.$this->imageType, NULL, NULL, ($ext ? $ext : $this->imageType)))
if (!imageResize($tmpName, _PS_IMG_DIR_.$dir.$id.'.'.$this->imageType, (int)$width, (int)$height, ($ext ? $ext : $this->imageType)))
$this->_errors[] = Tools::displayError('An error occurred while uploading image.');
if (sizeof($this->_errors))
return false;