diff --git a/classes/FileUploader.php b/classes/FileUploader.php
index ccdf5e5ec..0bc04c976 100755
--- a/classes/FileUploader.php
+++ b/classes/FileUploader.php
@@ -95,29 +95,29 @@ class FileUploaderCore
/**
* Handle file uploads via XMLHttpRequest
*/
-class qqUploadedFileXhr
+class qqUploadedFileXhr
{
/**
* Save the file to the specified path
* @return boolean TRUE on success
*/
- function upload($path)
- {
+ function upload($path)
+ {
$input = fopen("php://input", "r");
$temp = tmpfile();
$realSize = stream_copy_to_stream($input, $temp);
fclose($input);
- if ($realSize != $this->getSize())
+ if ($realSize != $this->getSize())
return false;
- $target = fopen($path, "w");
+ $target = fopen($path, "w");
fseek($temp, 0, SEEK_SET);
stream_copy_to_stream($temp, $target);
fclose($target);
-
+
return true;
}
-
- function save()
+
+ function save()
{
$product = new Product($_GET['id_product']);
if (!Validate::isLoadedObject($product))
@@ -134,12 +134,12 @@ class qqUploadedFileXhr
if (!$image->add())
return array('error' => Tools::displayError('Error while creating additional image'));
else
- {
+ {
return $this->copyImage($product->id, $image->id);
}
}
}
-
+
public function copyImage($id_product, $id_image, $method = 'auto')
{
$image = new Image($id_image);
@@ -154,11 +154,8 @@ class qqUploadedFileXhr
{
$imagesTypes = ImageType::getImagesTypes('products');
foreach ($imagesTypes AS $k => $imageType)
- {
- $theme = (Shop::isFeatureActive() ? '-'.$imageType['id_theme'] : '');
- if (!imageResize($tmpName, $new_path.'-'.stripslashes($imageType['name']).$theme.'.'.$image->image_format, $imageType['width'], $imageType['height'], $image->image_format))
+ if (!imageResize($tmpName, $new_path.'-'.stripslashes($imageType['name']).'.'.$image->image_format, $imageType['width'], $imageType['height'], $image->image_format))
return array('error' => Tools::displayError('An error occurred while copying image:').' '.stripslashes($imageType['name']));
- }
}
unlink($tmpName);
Hook::exec('watermark', array('id_image' => $id_image, 'id_product' => $id_product));
@@ -169,17 +166,17 @@ class qqUploadedFileXhr
$img = array('id_image' => $image->id, 'position' => $image->position, 'cover' => $image->cover);
return array("success" => $img);
}
-
- function getName()
+
+ function getName()
{
return $_GET['qqfile'];
}
- function getSize()
+ function getSize()
{
if (isset($_SERVER["CONTENT_LENGTH"]))
- return (int)$_SERVER["CONTENT_LENGTH"];
- else
- throw new Exception('Getting content length is not supported.');
- }
+ return (int)$_SERVER["CONTENT_LENGTH"];
+ else
+ throw new Exception('Getting content length is not supported.');
+ }
}
diff --git a/classes/Image.php b/classes/Image.php
index fbc3ce99e..15dce1d27 100644
--- a/classes/Image.php
+++ b/classes/Image.php
@@ -238,13 +238,12 @@ class ImageCore extends ObjectModel
$new_path = $image_new->getPathForCreation();
foreach ($images_types as $image_type)
{
- $theme = (Shop::isFeatureActive() ? '-'.$image_type['id_theme'] : '');
- if (file_exists(_PS_PROD_IMG_DIR_.$image_old->getExistingImgPath().'-'.$image_type['name'].$theme.'.jpg'))
+ if (file_exists(_PS_PROD_IMG_DIR_.$image_old->getExistingImgPath().'-'.$image_type['name'].'.jpg'))
{
if (!Configuration::get('PS_LEGACY_IMAGES'))
$image_new->createImgFolder();
- copy(_PS_PROD_IMG_DIR_.$image_old->getExistingImgPath().'-'.$image_type['name'].$theme.'.jpg',
- $new_path.'-'.$image_type['name'].$theme.'.jpg');
+ copy(_PS_PROD_IMG_DIR_.$image_old->getExistingImgPath().'-'.$image_type['name'].'.jpg',
+ $new_path.'-'.$image_type['name'].'.jpg');
}
}
if (file_exists(_PS_PROD_IMG_DIR_.$image_old->getExistingImgPath().'.jpg'))
@@ -402,10 +401,8 @@ class ImageCore extends ObjectModel
// Delete auto-generated images
$image_types = ImageType::getImagesTypes();
foreach ($image_types as $image_type)
- {
- $theme = (Shop::isFeatureActive() ? '-'.$image_type['id_theme'] : '');
- $files_to_delete[] = $this->image_dir.$this->getExistingImgPath().'-'.$image_type['name'].$theme.'.'.$this->image_format;
- }
+ $files_to_delete[] = $this->image_dir.$this->getExistingImgPath().'-'.$image_type['name'].'.'.$this->image_format;
+
// Delete watermark image
$files_to_delete[] = $this->image_dir.$this->getExistingImgPath().'-watermark.'.$this->image_format;
// delete index.php
diff --git a/classes/ImageType.php b/classes/ImageType.php
index 1259d8fbd..98c247fbf 100644
--- a/classes/ImageType.php
+++ b/classes/ImageType.php
@@ -1,6 +1,6 @@
'image_type',
'primary' => 'id_image_type',
'fields' => array(
- 'id_theme' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
'name' => array('type' => self::TYPE_STRING, 'validate' => 'isImageTypeName', 'required' => true, 'size' => 16),
'width' => array('type' => self::TYPE_INT, 'validate' => 'isImageSize', 'required' => true),
'height' => array('type' => self::TYPE_INT, 'validate' => 'isImageSize', 'required' => true),
@@ -83,7 +79,7 @@ class ImageTypeCore extends ObjectModel
* @var array Image types cache
*/
protected static $images_types_cache = array();
-
+
protected $webserviceParameters = array();
/**
@@ -92,17 +88,16 @@ class ImageTypeCore extends ObjectModel
* @param string|null Image type
* @return array Image type definitions
*/
- public static function getImagesTypes($type = NULL, $id_theme = false)
+ public static function getImagesTypes($type = NULL)
{
- if (!isset(self::$images_types_cache[$type.($id_theme ? '-'.$id_theme : '')]))
+ if (!isset(self::$images_types_cache[$type]))
{
- $where = 'WHERE 1';
- if ($id_theme)
- $where .= ' AND id_theme='.(int)$id_theme;
if (!empty($type))
- $where .= ' AND ' . pSQL($type) . ' = 1 ';
+ $where = 'WHERE ' . pSQL($type) . ' = 1 ';
+ else
+ $where = '';
- $query = 'SELECT * FROM `'._DB_PREFIX_.'image_type`'.$where.' ORDER BY `name` ASC';
+ $query = 'SELECT * FROM `'._DB_PREFIX_.'image_type`'.$where.'ORDER BY `name` ASC';
self::$images_types_cache[$type] = Db::getInstance()->executeS($query);
}
diff --git a/classes/Link.php b/classes/Link.php
index 6dc70fe07..10b65fee7 100644
--- a/classes/Link.php
+++ b/classes/Link.php
@@ -306,26 +306,24 @@ class LinkCore
public function getImageLink($name, $ids, $type = null)
{
// legacy mode or default image
- $theme = ((Shop::isFeatureActive() && file_exists(_PS_PROD_IMG_DIR_.$ids.($type ? '-'.$type : '').'-'.(int)Context::getContext()->shop->id_theme.'.jpg')) ? '-'.Context::getContext()->shop->id_theme : '');
if ((Configuration::get('PS_LEGACY_IMAGES')
- && (file_exists(_PS_PROD_IMG_DIR_.$ids.($type ? '-'.$type : '').$theme.'.jpg')))
+ && (file_exists(_PS_PROD_IMG_DIR_.$ids.($type ? '-'.$type : '').'.jpg')))
|| strpos($ids, 'default') !== false)
{
- if ($this->allow == 1)
- $uri_path = __PS_BASE_URI__.$ids.($type ? '-'.$type : '').$theme.'/'.$name.'.jpg';
- else
- $uri_path = _THEME_PROD_DIR_.$ids.($type ? '-'.$type : '').$theme.'.jpg';
- }
+ if ($this->allow == 1)
+ $uri_path = __PS_BASE_URI__.$ids.($type ? '-'.$type : '').'/'.$name.'.jpg';
else
+ $uri_path = _THEME_PROD_DIR_.$ids.($type ? '-'.$type : '').'.jpg';
+ }else
{
// if ids if of the form id_product-id_image, we want to extract the id_image part
$split_ids = explode('-', $ids);
$id_image = (isset($split_ids[1]) ? $split_ids[1] : $split_ids[0]);
- $theme = ((Shop::isFeatureActive() && file_exists(_PS_PROD_IMG_DIR_.Image::getImgFolderStatic($id_image).$id_image.($type ? '-'.$type : '').'-'.(int)Context::getContext()->shop->id_theme.'.jpg')) ? '-'.Context::getContext()->shop->id_theme : '');
+
if ($this->allow == 1)
- $uri_path = __PS_BASE_URI__.$id_image.($type ? '-'.$type : '').$theme.'/'.$name.'.jpg';
+ $uri_path = __PS_BASE_URI__.$id_image.($type ? '-'.$type : '').'/'.$name.'.jpg';
else
- $uri_path = _THEME_PROD_DIR_.Image::getImgFolderStatic($id_image).$id_image.($type ? '-'.$type : '').$theme.'.jpg';
+ $uri_path = _THEME_PROD_DIR_.Image::getImgFolderStatic($id_image).$id_image.($type ? '-'.$type : '').'.jpg';
}
return $this->protocol_content.Tools::getMediaServer($uri_path).$uri_path;
diff --git a/classes/Tools.php b/classes/Tools.php
index d2c24cc6c..a0718699a 100644
--- a/classes/Tools.php
+++ b/classes/Tools.php
@@ -42,7 +42,7 @@ class ToolsCore
{
switch ($flag)
{
- case 'NUMERIC':
+ case 'NUMERIC':
$str = '0123456789';
break;
case 'NO_NUMERIC':
@@ -52,7 +52,7 @@ class ToolsCore
$str = 'abcdefghijkmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
break;
}
-
+
for ($i = 0, $passwd = ''; $i < $length; $i++)
$passwd .= self::substr($str, mt_rand(0, self::strlen($str) - 1), 1);
return $passwd;
@@ -367,7 +367,7 @@ class ToolsCore
$context = Context::getContext();
if ($id_lang = (int)(self::getValue('id_lang')) AND Validate::isUnsignedId($id_lang))
$context->cookie->id_lang = $id_lang;
-
+
$language = new Language($id_lang);
if (Validate::isLoadedObject($language))
$context->language = $language;
@@ -558,10 +558,10 @@ class ToolsCore
{
if (!$date || !($time = strtotime($date)))
return $date;
-
+
if ($date == '0000-00-00 00:00:00' || $date == '0000-00-00')
return '';
-
+
if (!Validate::isDate($date) || !Validate::isBool($full))
throw new PrestashopException('Invalid date');
@@ -636,7 +636,7 @@ class ToolsCore
if (is_null($context))
$context = Context::getContext();
-
+
@include_once(_PS_TRANSLATIONS_DIR_.$context->language->iso_code.'/errors.php');
if (defined('_PS_MODE_DEV_') AND _PS_MODE_DEV_ AND $string == 'Fatal error')
@@ -1566,8 +1566,8 @@ class ToolsCore
fwrite($write_fd, "# Images\n");
if (Configuration::get('PS_LEGACY_IMAGES'))
{
- fwrite($write_fd, 'RewriteRule (*UTF8)^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)(-[0-9]+)?/[_a-zA-Z0-9-\pL]*\.jpg$ '._PS_PROD_IMG_.'$1-$2$3$4.jpg [L]'."\n");
- fwrite($write_fd, 'RewriteRule (*UTF8)^([0-9]+)\-([0-9]+)(-[0-9]+)?/[_a-zA-Z0-9-\pL]*\.jpg$ '._PS_PROD_IMG_.'$1-$2$3.jpg [L]'."\n");
+ fwrite($write_fd, 'RewriteRule ^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-\pL]*\.jpg$ '._PS_PROD_IMG_.'$1-$2$3.jpg [L]'."\n");
+ fwrite($write_fd, 'RewriteRule ^([0-9]+)\-([0-9]+)/[_a-zA-Z0-9-\pL]*\.jpg$ '._PS_PROD_IMG_.'$1-$2.jpg [L]'."\n");
}
// Rewrite product images < 100 millions
@@ -1580,10 +1580,10 @@ class ToolsCore
$img_name .= '$'.$j;
}
$img_name .= '$'.$j;
- fwrite($write_fd, 'RewriteRule (*UTF8)^'.str_repeat('([0-9])', $i).'(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/[_a-zA-Z0-9-\pL]*\.jpg$ '._PS_PROD_IMG_.$img_path.$img_name.'$'.($j+1).".jpg [L]\n");
+ fwrite($write_fd, 'RewriteRule ^'.str_repeat('([0-9])', $i).'(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-\pL]*\.jpg$ '._PS_PROD_IMG_.$img_path.$img_name.".jpg [L]\n");
}
- fwrite($write_fd, 'RewriteRule (*UTF8)^c/([0-9]+)(\-[_a-zA-Z0-9-\pL]*)(-[0-9]+)?/[_a-zA-Z0-9-]*\.jpg$ img/c/$1$2$3.jpg [L]'."\n");
- fwrite($write_fd, 'RewriteRule (*UTF8)^c/([a-zA-Z-]+)(-[0-9]+)?/[a-zA-Z0-9-\pL]+\.jpg$ img/c/$1$2.jpg [L]'."\n");
+ fwrite($write_fd, 'RewriteRule ^c/([0-9]+)(\-[_a-zA-Z0-9-\pL]*)/[_a-zA-Z0-9-]*\.jpg$ img/c/$1$2.jpg [L]'."\n");
+ fwrite($write_fd, 'RewriteRule ^c/([a-zA-Z-]+)/[a-zA-Z0-9-\pL]+\.jpg$ img/c/$1.jpg [L]'."\n");
}
// Redirections to dispatcher
@@ -1702,7 +1702,7 @@ FileETag INode MTime Size
$error = 'Parameter '.$parameter.' in function '.$callee['function'].'() is deprecated in '.$callee['file'].' on line '.$callee['Line'].'
';
$message = 'The parameter '.$parameter.' in function '.$callee['function'].' (Line '.$callee['Line'].') is deprecated and will be removed in the next major version.';
- trigger_error($message, E_WARNING);
+ trigger_error($message, E_WARNING);
$class = isset($callee['class']) ? $callee['class'] : null;
self::throwDeprecated($error, $message, $class);
}
@@ -2092,7 +2092,7 @@ FileETag INode MTime Size
return false;
}
-
+
/**
* @params string $path Path to scan
@@ -2108,15 +2108,15 @@ FileETag INode MTime Size
$files = scandir($real_path);
if (!$files)
return array();
-
+
$filtered_files = array();
-
+
$real_ext = '';
if (!empty($ext))
$real_ext = '.' . $ext;
-
+
$real_ext_length = strlen($real_ext);
-
+
foreach ($files as $file)
if (strpos($file, $real_ext) && strpos($file, $real_ext) == (strlen($file) - $real_ext_length))
$filtered_files[] = $dir . '/' . $file;
diff --git a/classes/webservice/WebserviceSpecificManagementImages.php b/classes/webservice/WebserviceSpecificManagementImages.php
index 12470831d..27a7de9ed 100755
--- a/classes/webservice/WebserviceSpecificManagementImages.php
+++ b/classes/webservice/WebserviceSpecificManagementImages.php
@@ -982,11 +982,8 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
{
$imagesTypes = ImageType::getImagesTypes('products');
foreach ($imagesTypes AS $imageType)
- {
- $theme = (Shop::isFeatureActive() ? '-'.$image_type['id_theme'] : '');
- if (!imageResize($tmpName, _PS_PROD_IMG_DIR_.$image->getExistingImgPath().'-'.stripslashes($imageType['name']).$theme.'.'.$image->image_format, $imageType['width'], $imageType['height'], $image->image_format))
+ if (!imageResize($tmpName, _PS_PROD_IMG_DIR_.$image->getExistingImgPath().'-'.stripslashes($imageType['name']).'.'.$image->image_format, $imageType['width'], $imageType['height'], $image->image_format))
$this->_errors[] = Tools::displayError('An error occurred while copying image:').' '.stripslashes($imageType['name']);
- }
}
@unlink($tmpName);
$this->imgToDisplay = _PS_PROD_IMG_DIR_.$image->getExistingImgPath().'.'.$image->image_format;
@@ -1007,4 +1004,4 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
else
throw new WebserviceException('Method '.$this->wsObject->method.' is not allowed for an image resource', array(77, 405));
}
-}
+}
\ No newline at end of file
diff --git a/controllers/admin/AdminCategoriesController.php b/controllers/admin/AdminCategoriesController.php
index d1206b954..94a8d2b11 100644
--- a/controllers/admin/AdminCategoriesController.php
+++ b/controllers/admin/AdminCategoriesController.php
@@ -89,7 +89,7 @@ class AdminCategoriesControllerCore extends AdminController
parent::__construct();
}
-
+
public function setMedia()
{
parent::setMedia();
@@ -425,14 +425,11 @@ class AdminCategoriesControllerCore extends AdminController
{
$images_types = ImageType::getImagesTypes('categories');
foreach ($images_types as $k => $image_type)
- {
- $theme = (Shop::isFeatureActive() ? '-'.$image_type['id_theme'] : '');
imageResize(
_PS_CAT_IMG_DIR_.$id_category.'.jpg',
- _PS_CAT_IMG_DIR_.$id_category.'-'.stripslashes($image_type['name']).$theme.'.jpg',
+ _PS_CAT_IMG_DIR_.$id_category.'-'.stripslashes($image_type['name']).'.jpg',
(int)$image_type['width'], (int)$image_type['height']
);
- }
}
return $ret;
}
diff --git a/controllers/admin/AdminImagesController.php b/controllers/admin/AdminImagesController.php
index 25050285b..eccffb05d 100644
--- a/controllers/admin/AdminImagesController.php
+++ b/controllers/admin/AdminImagesController.php
@@ -69,13 +69,6 @@ class AdminImagesControllerCore extends AdminController
'title' => $this->l('Images'),
'image' => '../img/admin/picture.gif'
),
- 'input' => array(
- array(
- 'type' => 'text',
- 'label' => $this->l('Theme:'),
- 'name' => 'theme',
-
- ),
'input' => array(
array(
'type' => 'text',
@@ -370,8 +363,6 @@ class AdminImagesControllerCore extends AdminController
if (preg_match('/^[0-9]*\.jpg$/', $image))
foreach ($type AS $k => $imageType)
{
-
- $theme = (Shop::isFeatureActive() ? '-'.$imageType['id_theme'] : '');
// Customizable writing dir
$newDir = $dir;
if ($imageType['name'] == 'thumb_scene')
@@ -379,7 +370,7 @@ class AdminImagesControllerCore extends AdminController
if (!file_exists($newDir))
continue;
if (!file_exists($newDir.substr($image, 0, -4).'-'.stripslashes($imageType['name']).'.jpg'))
- if (!imageResize($dir.$image, $newDir.substr($image, 0, -4).'-'.stripslashes($imageType['name']).$theme.'.jpg', (int)($imageType['width']), (int)($imageType['height'])))
+ if (!imageResize($dir.$image, $newDir.substr($image, 0, -4).'-'.stripslashes($imageType['name']).'.jpg', (int)($imageType['width']), (int)($imageType['height'])))
$errors = true;
if (time() - $this->start_time > $this->max_execution_time - 4) // stop 4 seconds before the tiemout, just enough time to process the end of the page on a slow server
return 'timeout';
@@ -394,16 +385,14 @@ class AdminImagesControllerCore extends AdminController
if (file_exists($dir.$imageObj->getExistingImgPath().'.jpg'))
foreach ($type AS $k => $imageType)
{
- $theme = (Shop::isFeatureActive() ? '-'.$imageType['id_theme'] : '');
if (!file_exists($dir.$imageObj->getExistingImgPath().'-'.stripslashes($imageType['name']).'.jpg'))
- if (!imageResize($dir.$imageObj->getExistingImgPath().'.jpg', $dir.$imageObj->getExistingImgPath().'-'.stripslashes($imageType['name']).$theme.'.jpg', (int)($imageType['width']), (int)($imageType['height'])))
+ if (!imageResize($dir.$imageObj->getExistingImgPath().'.jpg', $dir.$imageObj->getExistingImgPath().'-'.stripslashes($imageType['name']).'.jpg', (int)($imageType['width']), (int)($imageType['height'])))
$errors = true;
if (time() - $this->start_time > $this->max_execution_time - 4) // stop 4 seconds before the tiemout, just enough time to process the end of the page on a slow server
return 'timeout';
}
- }
}
-
+ }
return $errors;
}
@@ -412,18 +401,15 @@ class AdminImagesControllerCore extends AdminController
{
$errors = false;
foreach ($type AS $k => $imageType)
- {
- $theme = (Shop::isFeatureActive() ? '-'.$imageType['id_theme'] : '');
foreach ($languages AS $language)
{
$file = $dir.$language['iso_code'].'.jpg';
if (!file_exists($file))
$file = _PS_PROD_IMG_DIR_.Language::getIsoById((int)(Configuration::get('PS_LANG_DEFAULT'))).'.jpg';
if (!file_exists($dir.$language['iso_code'].'-default-'.stripslashes($imageType['name']).'.jpg'))
- if (!imageResize($file, $dir.$language['iso_code'].'-default-'.stripslashes($imageType['name']).$theme.'.jpg', (int)($imageType['width']), (int)($imageType['height'])))
+ if (!imageResize($file, $dir.$language['iso_code'].'-default-'.stripslashes($imageType['name']).'.jpg', (int)($imageType['width']), (int)($imageType['height'])))
$errors = true;
}
- }
return $errors;
}
diff --git a/controllers/admin/AdminImportController.php b/controllers/admin/AdminImportController.php
index 695210604..5824b1ec9 100644
--- a/controllers/admin/AdminImportController.php
+++ b/controllers/admin/AdminImportController.php
@@ -700,10 +700,7 @@ class AdminImportControllerCore extends AdminController
imageResize($tmpfile, $path.'.jpg');
$images_types = ImageType::getImagesTypes($entity);
foreach ($images_types as $k => $image_type)
- {
- $theme = (Shop::isFeatureActive() ? '-'.$image_type['id_theme'] : '');
- imageResize($tmpfile, $path.'-'.stripslashes($image_type['name']).$theme.'.jpg', $image_type['width'], $image_type['height']);
- }
+ imageResize($tmpfile, $path.'-'.stripslashes($image_type['name']).'.jpg', $image_type['width'], $image_type['height']);
if (in_array($image_type['id_image_type'], $watermark_types))
Hook::exec('watermark', array('id_image' => $id_image, 'id_product' => $id_entity));
}
diff --git a/controllers/admin/AdminLanguagesController.php b/controllers/admin/AdminLanguagesController.php
index 6b0cb8c41..c7e9ed8eb 100644
--- a/controllers/admin/AdminLanguagesController.php
+++ b/controllers/admin/AdminLanguagesController.php
@@ -433,12 +433,11 @@ class AdminLanguagesControllerCore extends AdminController
$images_types = ImageType::getImagesTypes('products');
foreach ($images_types as $k => $image_type)
{
- $theme = (Shop::isFeatureActive() ? '-'.$image_type['id_theme'] : '');
- if (!imageResize($tmp_name, _PS_IMG_DIR_.'p/'.$language.'-default-'.stripslashes($image_type['name']).$theme.'.jpg', $image_type['width'], $image_type['height']))
+ if (!imageResize($tmp_name, _PS_IMG_DIR_.'p/'.$language.'-default-'.stripslashes($image_type['name']).'.jpg', $image_type['width'], $image_type['height']))
$this->_errors[] = Tools::displayError('An error occurred while resizing no-picture image to your product directory.');
- if (!imageResize($tmp_name, _PS_IMG_DIR_.'c/'.$language.'-default-'.stripslashes($image_type['name']).$theme.'.jpg', $image_type['width'], $image_type['height']))
+ if (!imageResize($tmp_name, _PS_IMG_DIR_.'c/'.$language.'-default-'.stripslashes($image_type['name']).'.jpg', $image_type['width'], $image_type['height']))
$this->_errors[] = Tools::displayError('An error occurred while resizing no-picture image to your category directory.');
- if (!imageResize($tmp_name, _PS_IMG_DIR_.'m/'.$language.'-default-'.stripslashes($image_type['name']).$theme.'.jpg', $image_type['width'], $image_type['height']))
+ if (!imageResize($tmp_name, _PS_IMG_DIR_.'m/'.$language.'-default-'.stripslashes($image_type['name']).'.jpg', $image_type['width'], $image_type['height']))
$this->_errors[] = Tools::displayError('An error occurred while resizing no-picture image to your manufacturer directory.');
}
}
diff --git a/controllers/admin/AdminManufacturersController.php b/controllers/admin/AdminManufacturersController.php
index 42c89e3b8..591da4487 100644
--- a/controllers/admin/AdminManufacturersController.php
+++ b/controllers/admin/AdminManufacturersController.php
@@ -683,15 +683,12 @@ class AdminManufacturersControllerCore extends AdminController
{
$images_types = ImageType::getImagesTypes('manufacturers');
foreach ($images_types as $k => $image_type)
- {
- $theme = (Shop::isFeatureActive() ? '-'.$image_type['id_theme'] : '');
imageResize(
_PS_MANU_IMG_DIR_.$id_manufacturer.'.jpg',
- _PS_MANU_IMG_DIR_.$id_manufacturer.'-'.stripslashes($image_type['name']).$theme.'.jpg',
+ _PS_MANU_IMG_DIR_.$id_manufacturer.'-'.stripslashes($image_type['name']).'.jpg',
(int)$image_type['width'],
(int)$image_type['height']
);
- }
}
}
}
diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php
index 3209e8a52..e96ac616d 100644
--- a/controllers/admin/AdminProductsController.php
+++ b/controllers/admin/AdminProductsController.php
@@ -92,7 +92,7 @@ class AdminProductsControllerCore extends AdminController
$this->_defaultOrderBy = 'position';
$this->max_file_size = (Configuration::get('PS_LIMIT_UPLOAD_IMAGE_VALUE') * 1000000);
$this->max_image_size = (Configuration::get('PS_LIMIT_UPLOAD_FILE_VALUE') * 1000000);
-
+
$categoriesArray = array();
$categories = Category::getSimpleCategories($this->context->language->id);
@@ -1370,11 +1370,8 @@ class AdminProductsControllerCore extends AdminController
{
$imagesTypes = ImageType::getImagesTypes('products');
foreach ($imagesTypes as $k => $image_type)
- {
- $theme = (Shop::isFeatureActive() ? '-'.$image_type['id_theme'] : '');
- if (!imageResize($tmpName, $new_path.'-'.stripslashes($image_type['name']).$theme.'.'.$image->image_format, $image_type['width'], $image_type['height'], $image->image_format))
+ if (!imageResize($tmpName, $new_path.'-'.stripslashes($image_type['name']).'.'.$image->image_format, $image_type['width'], $image_type['height'], $image->image_format))
$this->_errors[] = Tools::displayError('An error occurred while copying image:').' '.stripslashes($image_type['name']);
- }
}
@unlink($tmpName);
diff --git a/controllers/admin/AdminScenesController.php b/controllers/admin/AdminScenesController.php
index 5572ed102..f66b18b2f 100644
--- a/controllers/admin/AdminScenesController.php
+++ b/controllers/admin/AdminScenesController.php
@@ -74,11 +74,10 @@ class AdminScenesControllerCore extends AdminController
$images_types = ImageType::getImagesTypes('scenes');
foreach ($images_types as $k => $image_type)
{
- $theme = (Shop::isFeatureActive() ? '-'.$image_type['id_theme'] : '');
if ($image_type['name'] == 'large_scene' && isset($_FILES['image']))
imageResize(
$_FILES['image']['tmp_name'],
- _PS_SCENE_IMG_DIR_.$obj->id.'-'.stripslashes($image_type['name']).$theme.'.jpg',
+ _PS_SCENE_IMG_DIR_.$obj->id.'-'.stripslashes($image_type['name']).'.jpg',
(int)$image_type['width'],
(int)$image_type['height']
);
@@ -90,7 +89,7 @@ class AdminScenesControllerCore extends AdminController
$tmp_name = $_FILES['image']['tmp_name'];
imageResize(
$tmp_name,
- _PS_SCENE_THUMB_IMG_DIR_.$obj->id.'-'.stripslashes($image_type['name']).$theme.'.jpg',
+ _PS_SCENE_THUMB_IMG_DIR_.$obj->id.'-'.stripslashes($image_type['name']).'.jpg',
(int)$image_type['width'],
(int)$image_type['height']
);
@@ -190,7 +189,7 @@ class AdminScenesControllerCore extends AdminController
.(Tools::getMaxUploadSize() / 1024).''.$this->l('KB max.').' '
.$this->l('If larger than the image size setting, the image will be reduced to ')
.' '.$large_scene_image_type['width'].'x'.$large_scene_image_type['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
+ .$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).');
if ($obj->id && file_exists(_PS_SCENE_IMG_DIR_.$obj->id.'-large_scene.jpg'))
@@ -204,7 +203,7 @@ class AdminScenesControllerCore extends AdminController
$image_to_map_desc .= '