Iowarth, well, the good news is that a hex editor reveals that your script is indeed dealing with the image as it should. The server and your test are both using the same GD versions, and one would think they are using the same headers.
Now for the bad news; your headers are not correct.
Check this out; the headers delivered for the working copy:
Quote:
HTTP/1.x 200 OK
Date: Tue, 17 Mar 2009 08:25:40 GMT
Server: Apache/2
X-Powered-By: PHP/4.4.9
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: image/jpeg
And from the unworking copy:
Quote:
HTTP/1.x 200 OK
Date: Tue, 17 Mar 2009 08:25:37 GMT
Server: Apache
X-Powered-By: PHP/5.2.8
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html
See? content type is text/html!
I have my own image script that resizes images for me which you can see here:
http://omniimpact.com/snippet_resources ... &square=60I am using PHP 5.2.6, and it works just fine, so it SHOULD be POSSIBLE.
Have you contacted your host, to see what they can tell you about the problem?
My guess is that like something I did myself before, there is something in the rest of the code that is outputting before the header. It is possible that the exact same code will react differently because you are going from a PHP 4.4.9 to 5.2.8, a much newer version!
Just for kicks and giggles, take that header() line OUT of the rest of the code, and just stick it right up there at the very top of the file. Just after the PHP tags open.