Posted by: gotroot801 Sep 15 2006, 06:28 PM
Any time I have a song whose album contains a hyphen (i.e.: "Genesis Archive 1967-1975"), I get the following errors from the PHP script when attempting to display the image:
CODE
Warning: imagettftext() [function.imagettftext]: Problem rendering glyph in /[...]/signature.php on line 240
Warning: Cannot modify header information - headers already sent by (output started at /[...]/signature.php:240) in /[...]/signature.php on line 327
Warning: Cannot modify header information - headers already sent by (output started at /[...]/signature.php:240) in /[...]/signature.php on line 331
Warning: Cannot modify header information - headers already sent by (output started at /[...]/signature.php:240) in /[...]/signature.php on line 332
Warning: Cannot modify header information - headers already sent by (output started at /[...]/signature.php:240) in /[...]/signature.php on line 333
At that point, it starts dumping out the PNG headers like it normally would.
Of course, the only workaround I can think of is to just not play albums with hyphens in them, but since I don't know enough PHP to figure out how to get around this
(or even to just suppress the errors), I was hoping someone here might.
EDIT: I'm able to suppress the warning by throwing a @ in front of the whole imagettftext function (line 233), but that's less than optimal - it starts drawing the album title, but stops as soon as it hits the hyphen.
Posted by: Serge Sep 16 2006, 12:31 PM
Try different font or use a function to strip/replace them with some other character.
Posted by: gotroot801 Sep 17 2006, 04:27 PM
QUOTE(Serge @ Sep 16 2006, 07:31 AM)
Try different font or use a function to strip/replace them with some other character.
The font didn't change things (I think the psge parses - as a mathematical operand), but I was able to find a workaround and made the following (admittedly ugly) change to signature.php at around line 194:
CODE
if(strlen($SONG['album'])>0) {
$alb = "$SONG[album]";
if(strlen($SONG['year'])>0) {
$alb .= " ($SONG[year])";
$alb_temp = str_replace("-", "–", $alb);
$alb = $alb_temp;
}
} else {
$alb = "";
}