Merge branch '3.2' of git+ssh://git@github.com/Dolibarr/dolibarr.git into 3.2.1
This commit is contained in:
commit
bf9fd6a2da
@ -2637,7 +2637,7 @@ class Product extends CommonObject
|
|||||||
|
|
||||||
if (! utf8_check($file)) $file=utf8_encode($file); // To be sure file is stored in UTF8 in memory
|
if (! utf8_check($file)) $file=utf8_encode($file); // To be sure file is stored in UTF8 in memory
|
||||||
|
|
||||||
if (dol_is_file($dir.$file) && preg_match('/(\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i',$dir.$file))
|
if (dol_is_file($dir.$file) && preg_match('/(\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i', $dir.$file))
|
||||||
{
|
{
|
||||||
$nbphoto++;
|
$nbphoto++;
|
||||||
$photo = $file;
|
$photo = $file;
|
||||||
@ -2646,8 +2646,8 @@ class Product extends CommonObject
|
|||||||
if ($size == 1) { // Format vignette
|
if ($size == 1) { // Format vignette
|
||||||
// On determine nom du fichier vignette
|
// On determine nom du fichier vignette
|
||||||
$photo_vignette='';
|
$photo_vignette='';
|
||||||
if (preg_match('/(\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i',$photo,$regs)) {
|
if (preg_match('/(\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i', $photo, $regs)) {
|
||||||
$photo_vignette=preg_replace('/'.$regs[0].'/i','',$photo)."_small".$regs[0];
|
$photo_vignette=preg_replace('/'.$regs[0].'/i', '', $photo)."_small".$regs[0];
|
||||||
if (! dol_is_file($dirthumb.$photo_vignette)) $photo_vignette='';
|
if (! dol_is_file($dirthumb.$photo_vignette)) $photo_vignette='';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2682,7 +2682,7 @@ class Product extends CommonObject
|
|||||||
{
|
{
|
||||||
$return.= '<br>';
|
$return.= '<br>';
|
||||||
// On propose la generation de la vignette si elle n'existe pas et si la taille est superieure aux limites
|
// On propose la generation de la vignette si elle n'existe pas et si la taille est superieure aux limites
|
||||||
if ($photo_vignette && preg_match('/(\.bmp|\.gif|\.jpg|\.jpeg|\.png)$/i',$photo) && ($product->imgWidth > $maxWidth || $product->imgHeight > $maxHeight))
|
if ($photo_vignette && preg_match('/(\.bmp|\.gif|\.jpg|\.jpeg|\.png)$/i', $photo) && ($product->imgWidth > $maxWidth || $product->imgHeight > $maxHeight))
|
||||||
{
|
{
|
||||||
$return.= '<a href="'.$_SERVER["PHP_SELF"].'?id='.$_GET["id"].'&action=addthumb&file='.urlencode($pdir.$viewfilename).'">'.img_picto($langs->trans('GenerateThumb'),'refresh').' </a>';
|
$return.= '<a href="'.$_SERVER["PHP_SELF"].'?id='.$_GET["id"].'&action=addthumb&file='.urlencode($pdir.$viewfilename).'">'.img_picto($langs->trans('GenerateThumb'),'refresh').' </a>';
|
||||||
}
|
}
|
||||||
@ -2769,16 +2769,16 @@ class Product extends CommonObject
|
|||||||
while (($file = readdir($handle)) != false)
|
while (($file = readdir($handle)) != false)
|
||||||
{
|
{
|
||||||
if (! utf8_check($file)) $file=utf8_encode($file); // readdir returns ISO
|
if (! utf8_check($file)) $file=utf8_encode($file); // readdir returns ISO
|
||||||
if (dol_is_file($dir.$file))
|
if (dol_is_file($dir.$file) && preg_match('/(\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i', $dir.$file))
|
||||||
{
|
{
|
||||||
$nbphoto++;
|
$nbphoto++;
|
||||||
|
|
||||||
// On determine nom du fichier vignette
|
// On determine nom du fichier vignette
|
||||||
$photo=$file;
|
$photo=$file;
|
||||||
$photo_vignette='';
|
$photo_vignette='';
|
||||||
if (preg_match('/(\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i',$photo,$regs))
|
if (preg_match('/(\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i', $photo, $regs))
|
||||||
{
|
{
|
||||||
$photo_vignette=preg_replace('/'.$regs[0].'/i','',$photo).'_small'.$regs[0];
|
$photo_vignette=preg_replace('/'.$regs[0].'/i', '', $photo).'_small'.$regs[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
$dirthumb = $dir.'thumbs/';
|
$dirthumb = $dir.'thumbs/';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user