Browse Source

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

Laurent Destailleur 9 years ago
parent
commit
c0b2d7405a
2 changed files with 3 additions and 3 deletions
  1. 2 2
      htdocs/core/lib/files.lib.php
  2. 1 1
      htdocs/core/lib/images.lib.php

+ 2 - 2
htdocs/core/lib/files.lib.php

@@ -1467,10 +1467,10 @@ function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesessio
 				{
 					// Create small thumbs for image (Ratio is near 16/9)
 					// 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)
 					// 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');

+ 1 - 1
htdocs/core/lib/images.lib.php

@@ -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     int		$quality        	Quality of compression (0=worst, 100=best)
  *      @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
  */
 function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName='_small', $quality=50, $outdir='thumbs', $targetformat=0)