Jump to content


Photo

gd help


  • Please log in to reply
4 replies to this topic

#1 Gary Tactic

Gary Tactic
  • Members
  • Pip
  • Newbie
  • 8 posts
  • LocationUK, Bristol

Posted 17 April 2006 - 09:07 PM

Hello,

I have written the following simple script to test whether my gd library is working properly.

 header("Content-type: image/jpeg");
 $im = imagecreatefromjpeg("./test.jpg");
 imagejpeg($im,'',20);
 imagedestroy($im);

This returns an error referring to the first line of code regardless of what the line is.

I am sure this means my gd library doesn't work, but webhostfreaks says the gd library is installed fine.

any ideas of how i can get round this?

Gary

#2 obsidian

obsidian
  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 17 April 2006 - 09:18 PM

what's the error?
You can't win, you can't lose, you can't break even... you can't even get out of the game.

<?php
while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx

#3 Gary Tactic

Gary Tactic
  • Members
  • Pip
  • Newbie
  • 8 posts
  • LocationUK, Bristol

Posted 17 April 2006 - 09:32 PM

[!--quoteo(post=365688:date=Apr 17 2006, 10:18 PM:name=obsidian)--][div class=\'quotetop\']QUOTE(obsidian @ Apr 17 2006, 10:18 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
what's the error?
[/quote]

Parse error: syntax error, unexpected T_STRING on line 2

referring to:

header("Content-type: image/jpeg");

#4 obsidian

obsidian
  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 17 April 2006 - 09:55 PM

[!--quoteo(post=365697:date=Apr 17 2006, 05:32 PM:name=Gary Tactic)--][div class=\'quotetop\']QUOTE(Gary Tactic @ Apr 17 2006, 05:32 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Parse error: syntax error, unexpected T_STRING on line 2

referring to:

header("Content-type: image/jpeg");
[/quote]

you may just need to get rid of any white space above the header() call.
You can't win, you can't lose, you can't break even... you can't even get out of the game.

<?php
while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx

#5 Gary Tactic

Gary Tactic
  • Members
  • Pip
  • Newbie
  • 8 posts
  • LocationUK, Bristol

Posted 18 April 2006 - 12:10 PM

[!--quoteo(post=365707:date=Apr 17 2006, 10:55 PM:name=obsidian)--][div class=\'quotetop\']QUOTE(obsidian @ Apr 17 2006, 10:55 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
you may just need to get rid of any white space above the header() call.
[/quote]

Wow, thank you very much, that error was driving me mad!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users