Comment garder la trensparance lors de la création des miniatures avec la nano galerie ??
voici le script (à peine modifié XD)
<?php function MakeThumb($f) { $fichierSource = $f; if (preg_match('/.(png)$/i', $f)) $source = ImageCreateFromPng($fichierSource); $largeurSource = imagesx($source); $hauteurSource = imagesy($source); /*$largeurDestination = 160; $hauteurDestination = $largeurDestination/$largeurSource*$hauteurSource;*/ $hauteurDestination = 128; $largeurDestination = $hauteurDestination/$hauteurSource*$largeurSource; if ($largeurDestination > 128) { $largeurDestination = 128; $hauteurDestination = $largeurDestination/$largeurSource*$hauteurSource; } $im = imagecreatetruecolor (128 , 128) or die ("Impossible de créer la miniature"); imagecopyresampled($im, $source, 0, 0, 0, 0, $largeurDestination, $hauteurDestination, $largeurSource, $hauteurSource); if (!file_exists("_thumb")) mkdir ("_thumb", 0700); $miniature = "_thumb/$fichierSource"; Imagepng ($im, $miniature); } function ShowThumb($f) { echo "<div class=\"body_gal\"><p class=\"texte_gal\"><strong>Nom de l'image :</strong> $f</p><p ><a href=\"$f\"><img src=\"_thumb/$f\" alt=\"$f\" /></a></p></div>"; } $dir = opendir('.'); while ($f = readdir($dir)) { if ($f !="." && $f != "..") { if (preg_match('/.(jpg)$/i', $f) or preg_match('/.(jpeg)$/i', $f) or preg_match('/.(png)$/i', $f)) { if (file_exists("_thumb/$f")) { ShowThumb($f); } else { MakeThumb($f); ShowThumb($f); } } } } closedir($dir); ?>
je l'ai intégré dans une page de mon site, et je l'ai doté d'un script d'upload pour que les membres puissent envoyer leurs créations.
Pouvez-vous m'aider ??