Skip to content
Snippets Groups Projects
Commit c0b2d740 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

FIX Generated thumbs must always use the png format so using thumbs can

work.
parent be838438
No related branches found
No related tags found
No related merge requests found
...@@ -1467,10 +1467,10 @@ function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesessio ...@@ -1467,10 +1467,10 @@ function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesessio
{ {
// Create small thumbs for image (Ratio is near 16/9) // Create small thumbs for image (Ratio is near 16/9)
// Used on logon for example // Used on logon for example
$imgThumbSmall = vignette($destpath, $maxwidthsmall, $maxheightsmall, '_small', 50, "thumbs"); $imgThumbSmall = vignette($destpath, $maxwidthsmall, $maxheightsmall, '_small', 50, "thumbs", IMAGETYPE_PNG);
// Create mini thumbs for image (Ratio is near 16/9) // Create mini thumbs for image (Ratio is near 16/9)
// Used on menu or for setup page for example // Used on menu or for setup page for example
$imgThumbMini = vignette($destpath, $maxwidthmini, $maxheightmini, '_mini', 50, "thumbs"); $imgThumbMini = vignette($destpath, $maxwidthmini, $maxheightmini, '_mini', 50, "thumbs", IMAGETYPE_PNG);
} }
setEventMessages($langs->trans("FileTransferComplete"), null, 'mesgs'); setEventMessages($langs->trans("FileTransferComplete"), null, 'mesgs');
......
...@@ -301,7 +301,7 @@ function dol_imageResizeOrCrop($file, $mode, $newWidth, $newHeight, $src_x=0, $s ...@@ -301,7 +301,7 @@ function dol_imageResizeOrCrop($file, $mode, $newWidth, $newHeight, $src_x=0, $s
* @param string $extName Extension to differenciate thumb file name ('_small', '_mini') * @param string $extName Extension to differenciate thumb file name ('_small', '_mini')
* @param int $quality Quality of compression (0=worst, 100=best) * @param int $quality Quality of compression (0=worst, 100=best)
* @param string $outdir Directory where to store thumb * @param string $outdir Directory where to store thumb
* @param int $targetformat New format of target (1,2,3,... or 0 to keep old format) * @param int $targetformat New format of target (IMAGETYPE_GIF, IMAGETYPE_JPG, IMAGETYPE_PNG, IMAGETYPE_BMP, IMAGETYPE_WBMP ... or 0 to keep old format)
* @return string Full path of thumb or '' if it fails * @return string Full path of thumb or '' if it fails
*/ */
function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName='_small', $quality=50, $outdir='thumbs', $targetformat=0) function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName='_small', $quality=50, $outdir='thumbs', $targetformat=0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment