468,514 Members | 1,122 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,514 developers. It's quick & easy.

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:to**@marston-home.demon.co.uk
mailto:To*********@hotmail.com
mailto:To**@tonymarston.net
http://www.tonymarston.net

Jul 17 '05 #1
2 3163
Tony Marston wrote:

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?


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
sh***@glassgiant.com
http://www.glassgiant.com
Jul 17 '05 #2
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

http://www.tonymarston.net/

"Shawn Wilson" <sh***@glassgiant.com> wrote in message
news:3F***************@glassgiant.com...
Tony Marston wrote:

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?
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
sh***@glassgiant.com
http://www.glassgiant.com

Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Robert J. O'Hara | last post: by
13 posts views Thread by moondaddy | last post: by
61 posts views Thread by phil-news-nospam | last post: by
8 posts views Thread by Yourself | last post: by
9 posts views Thread by Wayne Smith | last post: by
9 posts views Thread by pengypenguin | last post: by
2 posts views Thread by Aneesh Pulukkul[MCSD.Net] | last post: by
8 posts views Thread by mechphisto | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.