diff --git a/htdocs/core/lib/images.lib.php b/htdocs/core/lib/images.lib.php index 1d1a6b8c7b9..1e6ebfa6d85 100644 --- a/htdocs/core/lib/images.lib.php +++ b/htdocs/core/lib/images.lib.php @@ -33,7 +33,7 @@ $quality = 80; * Return if a filename is file name of a supported image format * * @param string $file Filename - * @return int -1=Not image filename, 0=Image filename but format not supported by PHP, 1=Image filename with format supported by this PHP + * @return int -1=Not image filename, 0=Image filename but format not supported for conversion by PHP, 1=Image filename with format supported by this PHP */ function image_format_supported($file) { @@ -57,12 +57,12 @@ function image_format_supported($file) { if (!function_exists($imgfonction)) { - // Fonctions de conversion non presente dans ce PHP + // Fonctions of conversion not available in this PHP return 0; } } - // Filename is a format image and supported by this PHP + // Filename is a format image and supported for conversion by this PHP return 1; } diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index e32f0c32f8f..8b7d27073c0 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4835,8 +4835,10 @@ class Product extends CommonObject global $conf; $dir = $sdir; - if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) { $dir .= '/'.get_exdir($this->id, 2, 0, 0, $this, 'product').$this->id."/photos/"; - } else { $dir .= '/'.get_exdir(0, 0, 0, 0, $this, 'product').dol_sanitizeFileName($this->ref).'/'; + if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) { + $dir .= '/'.get_exdir($this->id, 2, 0, 0, $this, 'product').$this->id."/photos/"; + } else { + $dir .= '/'.get_exdir(0, 0, 0, 0, $this, 'product').dol_sanitizeFileName($this->ref).'/'; } $nbphoto = 0; @@ -4847,9 +4849,11 @@ class Product extends CommonObject if (is_resource($handle)) { while (($file = readdir($handle)) !== false) { - if (!utf8_check($file)) { $file = utf8_encode($file); // To be sure data is stored in UTF8 in memory + if (!utf8_check($file)) { + $file = utf8_encode($file); // To be sure data is stored in UTF8 in memory } - if (dol_is_file($dir.$file) && image_format_supported($file) > 0) { return true; + if (dol_is_file($dir.$file) && image_format_supported($file) >= 0) { + return true; } } } diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index a15b6a3dd81..d18c3806363 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1446,7 +1446,7 @@ div.heightref { min-height: 80px; } div.divphotoref { - padding-: 20px; + padding-: 10px; } div.paginationref { padding-bottom: 10px; @@ -3602,6 +3602,7 @@ label.radioprivate { .photowithmargin { margin-bottom: 2px; margin-top: 10px; + margin-right: 10px; } .photowithborder { border: 1px solid #f0f0f0;