Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Dynamic Signature breaks with hyphens in album name
gotroot801
post Sep 15 2006, 06:28 PM
Post #1


Newbie
*

Group: Members
Posts: 3
Joined: 14-September 06
Member No.: 149



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.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Serge
post Sep 16 2006, 12:31 PM
Post #2


AMIP Developer
***

Group: Root Admin
Posts: 935
Joined: 12-March 06
Member No.: 1



Try different font or use a function to strip/replace them with some other character.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
gotroot801
post Sep 17 2006, 04:27 PM
Post #3


Newbie
*

Group: Members
Posts: 3
Joined: 14-September 06
Member No.: 149



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 = "";
  }
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members: