Page 1 of 1

image problems

Posted: Thu Jan 27, 2005 7:59 pm
by bst82551
Two questions:

1. How do I get the image to automatically expand to the size of the text string from the song.txt file? Is this possible?

2. Why is there a strange yen type character being displayed after each song? Here's an example:
Image

Code: Select all

<?php

$song = fopen("http://bst82551.ath.cx:8181/song.txt", "r");
$name = fread($song, 1024);
$im = imagecreatetruecolor(300, 15);
$color = imagecolorallocate($im, 223, 223, 223);
imagestring($im, 2, 1, 1, "Now Playing: ".$name."", $color);
imagejpeg($im);
imagedestroy($im);

?>
Brian

Posted: Thu Jan 27, 2005 8:02 pm
by feyd
http://php.net/imageftbbox

would probably be the best bet to know how big of an image to make.

As for the symbols, it's looks like an artifact of the output, or ancillary binary data..