par
xTG » 23 juin 2012, 18:00
Ah bah ceci explique cela...
Ton header() spécifie une image mais tu envoies aussi du HTML.
Voilà la correction.
Page d'affichage :
<html>
<body>
<img src="monScript.php" alt="" />
</body>
</html>
monScript.php
<?php
// Fichier et degrés de rotation
$filename = 'images/NESW.png';
$degrees = 15;
// Content type
header('Content-type: image/png');
// Chargement
$source = imagecreatefrompng($filename);
// Rotation
$rotate = imagerotate($source, $degrees, 0);
// Affichage
imagepng($rotate);
?>
Ah bah ceci explique cela...
Ton header() spécifie une image mais tu envoies aussi du HTML. ;)
Voilà la correction.
Page d'affichage :
[html]<html>
<body>
<img src="monScript.php" alt="" />
</body>
</html>[/html]
monScript.php
[php]<?php
// Fichier et degrés de rotation
$filename = 'images/NESW.png';
$degrees = 15;
// Content type
header('Content-type: image/png');
// Chargement
$source = imagecreatefrompng($filename);
// Rotation
$rotate = imagerotate($source, $degrees, 0);
// Affichage
imagepng($rotate);
?>[/php]