Subversion Repositories Sites.tela-botanica.org

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4 david 1
<?php
2
 
3
/***************************************************************************\
4
 *  SPIP, Systeme de publication pour l'internet                           *
5
 *                                                                         *
6
 *  Copyright (c) 2001-2005                                                *
7
 *  Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James  *
8
 *                                                                         *
9
 *  Ce programme est un logiciel libre distribue sous licence GNU/GPL.     *
10
 *  Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne.   *
11
\***************************************************************************/
12
 
13
 
14
include ("ecrire/inc_version.php3");
15
include_ecrire("inc_admin.php3");
16
include_ecrire("inc_logos.php3");
17
 
18
if (!$taille_y)
19
	$taille_y = $taille_x;
20
 
21
// Chercher l'image dans le repertoire IMG/
22
if (eregi("(\.\./)?(.*)\.(jpg|gif|png)$", $img, $regs)
23
AND $i = cherche_image_nommee($regs[2], array($regs[3])) # hu ?
24
) {
25
	$img = $i[0].$i[1].'.'.$i[2];
26
	// si on a deja la bonne taille, pas la peine de se fatiguer
27
	$taille = @getimagesize($img);
28
	if ($taille_x == $taille[0] AND $taille_y == $taille[1])
29
		$stop = true;
30
}
31
 
32
if (lire_meta('creer_preview') <> 'oui')
33
	$stop = true;
34
 
35
if (!$stop
36
AND verifier_action_auteur("reduire $taille_x $taille_y", $hash, $hash_id_auteur))
37
	{
38
		list($dir,$nom,$format) = $i;
39
		$logo = $dir . $nom . '.' . $format;
40
 
41
		include_ecrire("inc_logos.php3");
42
		$suffixe = '-'.$taille_x.'x'.$taille_y;
43
		$preview = creer_vignette($logo, $taille_x, $taille_y, $format,('cache'.$suffixe), $nom.$suffixe);
44
		if ($preview)
45
			$img = $preview['fichier'];
46
}
47
 
48
// Envoie le navigateur vers l'image cible
49
redirige_par_entete($img);
50
 
51
 
52
?>