PHP help. using GD, dynamic images...

Live forum: http://forum.freeipodguide.com/viewtopic.php?t=41379

cwncool

16-06-2006 17:07:31

EDIT N/M. FIXED[/sizecb970dbb11]


I'm trying to make a script to create a new image from "http//www.gigacat.com/kitten.jpeg" (that's my own server) into another image with a string in the textbox of the picture. These are the two codes i've tried.
[code1cb970dbb11]<?php
$id = imagecreatefromjpeg("kitten.jpeg");
$string = "Meow, meow, meow!";
$black = imagecolorallocate($id, 0, 0, 0);
imagestring($id, "font.ttf", 170, 117, $string, $black);
imagejpeg($id,"newkitten.jpeg");
?>[/code1cb970dbb11]
on this first one i just end up with a blank, white page.

and this.
[code1cb970dbb11]<?php
header("Content-type: image/jpeg");
$id = imagecreatefromjpeg("kitten.jpeg");
$string = "Meow, meow, meow!";
$black = imagecolorallocate($id, 0, 0, 0);
imagestring($id, "font.ttf", 170, 117, $string, $black);
imagejpeg($id,"newkitten.jpeg");
?>[/code1cb970dbb11]
on this one, all I did was add the header, and it creates another blank, white page displaying the script's url on the page. Can someone please help me figure out what's wrong? Thanx!