//small improvement

This commit is contained in:
vAugagneur
2012-07-24 08:18:28 +00:00
parent d75608831b
commit a55b5b4475
+6 -6
View File
@@ -153,16 +153,16 @@ class InstallControllerHttpConfigure extends InstallControllerHttp
$thumb = imagecreatetruecolor($newwidth, $newheight); $thumb = imagecreatetruecolor($newwidth, $newheight);
switch ($type) switch ($type)
{ {
case 1: case IMAGETYPE_GIF:
$source = imagecreatefromgif($file['tmp_name']); $source = imagecreatefromgif($file['tmp_name']);
break; break;
case 2: case IMAGETYPE_PNG:
$source = imagecreatefromjpeg($file['tmp_name']); $source = imagecreatefrompng($file['tmp_name']);
break; break;
case 3: case IMAGETYPE_JPEG:
$source = imagecreatefrompng($file['tmp_name']); $source = imagecreatefromjpeg($file['tmp_name']);
break; break;
default: default:
@@ -172,7 +172,7 @@ class InstallControllerHttpConfigure extends InstallControllerHttp
if (!$error) if (!$error)
{ {
imagecopyresampled($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); imagecopyresampled($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
if (!is_writable(_PS_ROOT_DIR_.'/img/logo.jpg')) if (!is_writable(_PS_ROOT_DIR_.'/img/'))
$error = $this->l('Image folder %s is not writable', _PS_ROOT_DIR_.'/img/'); $error = $this->l('Image folder %s is not writable', _PS_ROOT_DIR_.'/img/');
else if (!imagejpeg($thumb, _PS_ROOT_DIR_.'/img/logo.jpg', 90)) else if (!imagejpeg($thumb, _PS_ROOT_DIR_.'/img/logo.jpg', 90))
$error = $this->l('Cannot upload the file'); $error = $this->l('Cannot upload the file');