From 74a9817050f49e463bc6bf226bc3a877aea0708a Mon Sep 17 00:00:00 2001 From: Fil <fil@rezo.net> Date: Fri, 6 May 2005 13:58:21 +0000 Subject: [PATCH] =?UTF-8?q?annule=20la=20pr=C3=A9c=C3=A9dente=20modif=20po?= =?UTF-8?q?ur=20les=20images=20r=C3=A9duites?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ecrire/inc_logos.php3 | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/ecrire/inc_logos.php3 b/ecrire/inc_logos.php3 index ce20c0e86e..e7518cff28 100644 --- a/ecrire/inc_logos.php3 +++ b/ecrire/inc_logos.php3 @@ -476,27 +476,19 @@ function reduire_image_logo($img, $taille = -1, $taille_y = -1) { list ($destWidth,$destHeight, $ratio) = image_ratio( $taille_origine[0], $taille_origine[1], $taille, $taille_y); - // Si la taille n'est pas tres differente, laisser le browser - // faire la reduction - if ($ratio >= 2 - AND max($taille_origine[0], $taille_origine[1]) > 50) { - $suffixe = '-'.$destWidth.'x'.$destHeight; - $preview = creer_vignette($logo, $taille, $taille_y, - $format, ('cache'.$suffixe), $nom.$suffixe); + // Creer effectivement la vignette reduite + $suffixe = '-'.$destWidth.'x'.$destHeight; + $preview = creer_vignette($logo, $taille, $taille_y, + $format, ('cache'.$suffixe), $nom.$suffixe); + if ($preview) { + $logo = $preview['fichier']; + $destWidth = $preview['width']; + $destHeight = $preview['height']; } - if (!$preview) { - if (!_DIR_RESTREINT) - $date = '?date='.filemtime($logo); - return "<img src='$logo$date' width='$destWidth' height='$destHeight'$attributs />"; - } else { - $vignette = $preview['fichier']; - $width = $preview['width']; - $height = $preview['height']; - if (!_DIR_RESTREINT) - $date = '?date='.$preview['date']; - return "<img src='$vignette$date' width='$width' height='$height'$attributs />"; - } + if (!_DIR_RESTREINT) + $date = '?date='.filemtime($logo); + return "<img src='$logo$date' width='$destWidth' height='$destHeight'$attributs />"; } } } -- GitLab