PHP benim son izledim animes eşsiz bir forum imza yapmak istiyorum. Bu RSS beslemesi bulunur. Benim yerel apache sunucuda, görüntü iyi oluşturulur, ama ben bir sunucu üzerine yüklemek gibi, ben bir hata alıyorum, resim hiç de oluşturulur.
İşte benim kod ve ben Dreamweaver CS5 veya phpDesigner 7 de herhangi bir hata görünmüyor çünkü ben phpDesigner Run düğmesine basarsanız, bir hata alıyorum rağmen, sorunun ne olduğunu merak ediyorum, ama ne anlama geldiğini bilmiyorum. Hata aşağıdaki gibidir:
Satır: 6 - Fatal error: [php yolunda] içinde) (tanımsız işlev imagecreatefrompng Çağrı
Yani kod şudur:
<?php
// title & description arrays
$titleCuts = array();
$descCuts = array();
// bg image
$bgimg = imagecreatefrompng('sig_robin.png');
// colors
$white = imagecolorallocate($bgimg, 255, 255, 255);
$textColor = imagecolorallocate($bgimg, 245, 193, 9);
$shapeColor = imagecolorallocate($bgimg, 27, 20, 0);
// sxe <- xml url
$sxe = new SimpleXMLElement('http://myanimelist.net/rss.php?type=rw&u=fema', NULL, TRUE);
// shape
imagefilledrectangle($bgimg, 255, 20, 567, 279, $shapeColor);
// TEXTS
imagettftext($bgimg, 20, 0, 263, 52, $white, "my.ttf", "Latest Watched:");
// episodes' text
for($i=0;$i<5;$i++)
{
// title cut and joint
$titleCuts = explode(' ', $sxe->channel->item[$i]->title, -2);
$titleCut = implode(' ',$titleCuts);
// description (ep) cut and joint
$descCuts = explode(' ', $sxe->channel->item[$i]->description);
// output
imagettftext($bgimg, 10, 0, 270, 77+($i*45), $textColor, "my.ttf", $titleCut);
imagettftext($bgimg, 10, 0, 270+(strlen($titleCut)*7.2), 92+($i*45), $textColor, "my.ttf", "ep. ".$descCuts[2]);
}
header('Content-type: image/png');
// generating image
imagepng($bgimg);
?>
Şimdiden teşekkürler.
Edit:
As I removed the header, now I get a lot of error that it can't find the font file, but I'm dead sure that I wrote it correctly.
Onlar şöyle:
Uyarı: imagettftext () [function.imagettftext]: bulamadı açık / yazı içinde ... 19 hattı üzerinde