Jump to content

Problem with GD, not creating image.


Moargan

Recommended Posts

I don't really use any image functions very often, so I have no idea what I've done wrong here.

 

I recall having this problem before, but can't for the life of me remember, and can't seem to come up with the right search terms to find a solution.

 

I'm using the simplepie library to get feed data, and I just want to print the titles of the feed items one after another over this image.

 

Here's the file: http://ridiculouslogic.net/projects/feedimg/feed.php

 

And the source:

<?php 
include_once 'inc/simplepie.inc';
$feed = new SimplePie('http://feeds.arstechnica.com/arstechnica/everything');
$image = imagecreatefrompng("background.png");
$font = 'ARIAL.TTF';
$colour = imagecolorexact($image,0,0,0);
imagealphablending($image,true);
imagesavealpha($image,true);

$title = $feed->get_title();
$down = 5;
foreach ($feed->get_items(0, 0) as $item):
	$iTitle = $item->get_title();
        imagefttext($image,14,0,5,$down,$colour,$font,$iTitle);
	$down = $down + 16;
endforeach; 

imagepng($image);
?>

Link to comment
https://forums.phpfreaks.com/topic/202204-problem-with-gd-not-creating-image/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.