// Fix previous commit
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17477 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -600,14 +600,14 @@ class InstallXmlLoader
|
|||||||
if (!is_writable(dirname($target_file)))
|
if (!is_writable(dirname($target_file)))
|
||||||
$this->setError($this->language->l('Cannot create image "%1$s" (bad permissions on folder "%2$s")', $identifier.'-'.$type['name'], dirname($target_file)));
|
$this->setError($this->language->l('Cannot create image "%1$s" (bad permissions on folder "%2$s")', $identifier.'-'.$type['name'], dirname($target_file)));
|
||||||
// If a file named folder/entity-type.extension exists just copy it, this is an optimisation in order to prevent to much resize
|
// If a file named folder/entity-type.extension exists just copy it, this is an optimisation in order to prevent to much resize
|
||||||
else if (file_exists($origin_file))
|
elseif (file_exists($origin_file))
|
||||||
{
|
{
|
||||||
if (!@copy($origin_file, $target_file))
|
if (!@copy($origin_file, $target_file))
|
||||||
$this->setError($this->language->l('Cannot create image "%s"', $identifier.'-'.$type['name']));
|
$this->setError($this->language->l('Cannot create image "%s"', $identifier.'-'.$type['name']));
|
||||||
@chmod($target_file, 0644);
|
@chmod($target_file, 0644);
|
||||||
}
|
}
|
||||||
// Resize the image if no cache was prepared in fixtures
|
// Resize the image if no cache was prepared in fixtures
|
||||||
else if (!ImageManager::resize($from_path.$identifier.'.'.$extension, $target_file, $type['width'], $type['height']))
|
elseif (!ImageManager::resize($from_path.$identifier.'.'.$extension, $target_file, $type['width'], $type['height']))
|
||||||
$this->setError($this->language->l('Cannot create image "%1$s" for entity "%2$s"', $identifier.'-'.$type['name'], $entity));
|
$this->setError($this->language->l('Cannot create image "%1$s" for entity "%2$s"', $identifier.'-'.$type['name'], $entity));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -621,7 +621,7 @@ class InstallXmlLoader
|
|||||||
$dst_path = _PS_IMG_DIR_.'scenes/thumbs/';
|
$dst_path = _PS_IMG_DIR_.'scenes/thumbs/';
|
||||||
$entity_id = $this->retrieveId('scene', $identifier);
|
$entity_id = $this->retrieveId('scene', $identifier);
|
||||||
|
|
||||||
if (!@copy($from_path.$identifier.'-thumb_scene.jpg', $dst_path.$entity_id.'-thumb_scene.jpg'))
|
if (!@copy($from_path.$identifier.'-m_scene_default.jpg', $dst_path.$entity_id.'-m_scene_default.jpg'))
|
||||||
{
|
{
|
||||||
$this->setError($this->language->l('Cannot create image "%1$s" for entity "%2$s"', $identifier, 'scene'));
|
$this->setError($this->language->l('Cannot create image "%1$s" for entity "%2$s"', $identifier, 'scene'));
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user