Vous devez définir le type de contenu en-tête à header('content-type: image/jpeg');
J'ai mis en place un code similaire une fois pour un captcha
header("Content-type: image/png");
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
$string = "Type Me";
$im = imagecreatefrompng(IMAGEDIR."captcha.png");
$orange = imagecolorallocate($im, 0, 0, 0);
$px = (imagesx($im) - 7.5 * strlen($string))/2;
imagestring($im, 5, $px, 9, $string, $orange);
imagepng($im);
imagedestroy($im);
http://stackoverflow.com/questions/2010742/image-processing-et-output-using-gd-in-php – ke20