diff --git a/classes/pdf/HTMLTemplate.php b/classes/pdf/HTMLTemplate.php
index 2fcfd6d75..f96bab4a2 100755
--- a/classes/pdf/HTMLTemplate.php
+++ b/classes/pdf/HTMLTemplate.php
@@ -48,7 +48,11 @@ abstract class HTMLTemplateCore
$shop_name = $this->shop->name;
$path_logo = $this->getLogo();
- list($width, $height) = getimagesize(_PS_ROOT_DIR_.'/'.str_replace(Context::getContext()->shop->physical_uri, '', $path_logo));
+
+ $width = 0;
+ $height = 0;
+ if (!empty($path_logo))
+ list($width, $height) = getimagesize(_PS_ROOT_DIR_.'/'.str_replace(Context::getContext()->shop->physical_uri, '', $path_logo));
$this->smarty->assign(array(
'logo_path' => $path_logo,
@@ -113,9 +117,9 @@ abstract class HTMLTemplateCore
// we don't use _PS_ROOT_DIR_ and we let TCPDF add the document root.
$physical_uri = Context::getContext()->shop->physical_uri.'img/';
- if (Configuration::get('PS_LOGO_INVOICE') != false && file_exists(_PS_IMG_DIR_.Configuration::get('PS_LOGO_INVOICE')))
+ if (Configuration::get('PS_LOGO_INVOICE') != false && file_exists($physical_uri.Configuration::get('PS_LOGO_INVOICE')))
$logo = $physical_uri.Configuration::get('PS_LOGO_INVOICE');
- else if (Configuration::get('PS_LOGO') != false && file_exists(_PS_IMG_DIR_.Configuration::get('PS_LOGO')))
+ else if (Configuration::get('PS_LOGO') != false && file_exists($physical_uri.Configuration::get('PS_LOGO')))
$logo = $physical_uri.Configuration::get('PS_LOGO');
return $logo;