Why are my images coming out as garbled text?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tony Marston

    Why are my images coming out as garbled text?

    I have just moved my website to a new hosting provider as the previous one
    went belly-up. Everything is now fine except for one thing - my counter
    script which generates a PNG image is sending out garbled text instead of an
    image.

    This script has been working for months on my desktop and my laptop, and
    worked at my previous web host, but is failing with my new hosting company.

    PHP version 4.3.3
    GD library is reported as 2.0.15 in PHPINFO()

    Any ideas out there?

    --
    Tony Marston

    mailto:tony@mar ston-home.demon.co.u k
    mailto:TonyMars ton@hotmail.com
    mailto:Tony@ton ymarston.net
    This is Tony Marston's web site, containing personal information plus pages devoted to the Uniface 4GL development language, XML and XSL, PHP and MySQL, and a bit of COBOL




  • Shawn Wilson

    #2
    Re: Why are my images coming out as garbled text?

    Tony Marston wrote:[color=blue]
    >
    > I have just moved my website to a new hosting provider as the previous one
    > went belly-up. Everything is now fine except for one thing - my counter
    > script which generates a PNG image is sending out garbled text instead of an
    > image.
    >
    > This script has been working for months on my desktop and my laptop, and
    > worked at my previous web host, but is failing with my new hosting company.
    >
    > PHP version 4.3.3
    > GD library is reported as 2.0.15 in PHPINFO()
    >
    > Any ideas out there?[/color]

    You might want to post some code snippets. Does PNG Support = "enabled" in
    phpinfo()?
    Try commenting out the header("Content-type... line and put
    error_reporting (E_ALL); at the top of your script. That should hopefully give
    you an error message.

    Regards,
    Shawn

    --
    Shawn Wilson
    shawn@glassgian t.com

    Comment

    • Tony Marston

      #3
      Re: Why are my images coming out as garbled text?- SOLVED

      It's OK now, I have found the problem. My script used the include()
      statement to bring in my database username and password, but somehow when
      this include file was uploaded to my host's server an extra blank line
      appeared at the end. This blank line was being written to the output stream
      before anything else and causing my "header: ('Content-type: image/png');"
      to be ignored.

      This same include file on my local PC did not have this extra blank line, so
      it did not cause a problem.

      Tony Marston

      This is Tony Marston's web site, containing personal information plus pages devoted to the Uniface 4GL development language, XML and XSL, PHP and MySQL, and a bit of COBOL


      "Shawn Wilson" <shawn@glassgia nt.com> wrote in message
      news:3FEC8389.A D6CE60A@glassgi ant.com...[color=blue]
      > Tony Marston wrote:[color=green]
      > >
      > > I have just moved my website to a new hosting provider as the previous[/color][/color]
      one[color=blue][color=green]
      > > went belly-up. Everything is now fine except for one thing - my counter
      > > script which generates a PNG image is sending out garbled text instead[/color][/color]
      of an[color=blue][color=green]
      > > image.
      > >
      > > This script has been working for months on my desktop and my laptop, and
      > > worked at my previous web host, but is failing with my new hosting[/color][/color]
      company.[color=blue][color=green]
      > >
      > > PHP version 4.3.3
      > > GD library is reported as 2.0.15 in PHPINFO()
      > >
      > > Any ideas out there?[/color]
      >
      > You might want to post some code snippets. Does PNG Support = "enabled"[/color]
      in[color=blue]
      > phpinfo()?
      > Try commenting out the header("Content-type... line and put
      > error_reporting (E_ALL); at the top of your script. That should hopefully[/color]
      give[color=blue]
      > you an error message.
      >
      > Regards,
      > Shawn
      >
      > --
      > Shawn Wilson
      > shawn@glassgian t.com
      > http://www.glassgiant.com[/color]


      Comment

      Working...