From c10da56eef11d3be07bdce747fd65451bdc65bed Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 14 Oct 2007 11:07:42 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20on=20peut=20d=E9sormais=20cr=E9er=20des?= =?UTF-8?q?=20vignettes=20en=20GIF=20transparent=20Fix:=20imagefill=20bloq?= =?UTF-8?q?uait=20sur=20certain=20syst=E8me?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/lib/functions.inc.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/htdocs/lib/functions.inc.php b/htdocs/lib/functions.inc.php index 9f50ce18830..6e5e4e067bd 100644 --- a/htdocs/lib/functions.inc.php +++ b/htdocs/lib/functions.inc.php @@ -3364,7 +3364,15 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName='_small', $ $thumbWidth=round($thumbWidth); // Create empty image - $imgThumb = imagecreatetruecolor($thumbWidth, $thumbHeight); + if ($infoImg[2] == 1) + { + // Compatibilité image GIF + $imgThumb = imagecreate($thumbWidth, $thumbHeight); + } + else + { + $imgThumb = imagecreatetruecolor($thumbWidth, $thumbHeight); + } // Activate antialiasing for better quality if (function_exists('imageantialias')) @@ -3382,12 +3390,14 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName='_small', $ switch($infoImg[2]) { case 1: // Gif - $trans_colour = imagecolorallocatealpha($imgThumb, 255, 255, 255, 0); // 0, not 127 because transparent channel bugged with gif + $trans_colour = imagecolorallocate($imgThumb, 255, 255, 255); // On procède autrement pour le format GIF + imagecolortransparent($imgThumb,$trans_colour); break; case 2: // Jpg $trans_colour = imagecolorallocatealpha($imgThumb, 255, 255, 255, 0); break; case 3: // Png + imagealphablending($imgThumb,false); // Pour compatibilité sur certain système $trans_colour = imagecolorallocatealpha($imgThumb, 255, 255, 255, 127); // Keep transparent channel break; case 4: // Bmp