From e1e8254bcf19f7dd25d52710ee50eb5725712429 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Aug 2016 04:31:19 +0200 Subject: [PATCH] Fix thumbs are using same extension than original. --- htdocs/core/class/html.formfile.class.php | 6 ++---- htdocs/product/class/product.class.php | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index f4163a889f0..5a55b3a8a9c 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -860,10 +860,8 @@ class FormFile print ''; if (image_format_supported($file['name']) > 0) { - $minifile=getImageFileNameForSize($file['name'], '_mini', '.png'); // Thumbs are created with filename in lower case and with .png extension - //print $relativepath.'
'; - //print $file['path'].'/'.$minifile.'
'; - if (! dol_is_file($file['path'].'/'.$minifile)) $minifile=getImageFileNameForSize($file['name'], '_mini', '.'.$fileinfo['extension']); // For old thumbs + $minifile=getImageFileNameForSize($file['name'], '_mini'); // For new thumbs using same ext (in lower case howerver) than original + if (! dol_is_file($file['path'].'/'.$minifile)) $minifile=getImageFileNameForSize($file['name'], '_mini', '.png'); // For backward compatibility of old thumbs that were created with filename in lower case and with .png extension //print $file['path'].'/'.$minifile.'
'; print ''; print ''; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 982b109da99..7b3f1750003 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -3676,7 +3676,7 @@ class Product extends CommonObject if ($size == 1 || $size == 'small') { // Format vignette // Find name of thumb file - $photo_vignette=basename(getImageFileNameForSize($dir.$file, '_small', '.png')); + $photo_vignette=basename(getImageFileNameForSize($dir.$file, '_small')); if (! dol_is_file($dirthumb.$photo_vignette)) $photo_vignette=''; // Get filesize of original file