Witam.
Mam pewien kod, który powinien generować mi grafikę, coś a'la demotywator. Niestety, błędów nie pokazuje a tylko
Obrazek „http://localhost/new/index.php” nie może zostać wyświetlony, ponieważ zawiera błędy.
Oto mój kod:
header("Content-type: image/png");
$tytul = "tytuł";
$opis = "Jakiś dłuuuuugi opis";
$caly_obraz = imagecreatetruecolor(750, 600);
$grafika = imagecreatefromjpeg('sunset.jpg');
$czarny = imagecolorallocate($caly_obraz, 0, 0, 0);
$bialy = imagecolorallocate($caly_obraz, 255, 255, 255);
$stopka[0] = imagecolorallocate($caly_obraz, 128, 128, 128);
$stopka[1] = imageloadfont('arial.gdf');
$czcionka = 'arial.ttf';
imagefill($caly_obraz, 0, 0, $czarne_tlo);
imagefilledrectangle($caly_obraz, 70, 45, 680, 455, $bialy);
imagefilledrectangle($caly_obraz, 72, 47, 678, 453, $czarny);
imagestring($caly_obraz, $stopka[1], 660, 585, 'strona.pl', $stopka[0]);
imagestring($caly_obraz, $stopka[1], 10, 585, 'Garsi', $stopka[0]);
imagettftext($caly_obraz, 46, 0, 200, 510, $bialy, $czcionka, $tytul);
imagettftext($caly_obraz, 16, 0, 100, 555, $bialy, $czcionka, $opis);
imagecopy($caly_obraz, $grafika, 72, 47, 0, 0, 606, 406);
imagepng($caly_obraz);
imagedestroy($caly_obraz);
imagedestroy($grafika);
Co jest w nim nie tak?