If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

to the top and comment out the header for the content type, then access the image directly. One or more of these are throwing an error, suspicion goes to imagecreatefromjpeg failing, and since you have no other error handling the rest would all throw errors too.

Yes that would be the text of the image binary. Errors would show up first though, does it show errors? If not, check the source and verify that there is no preceding whitespace. If there is, then you have a space before the <?php in the script.

Whitespace = any whitespace character. If you contain output with whitespace it will corrupt the image binary.
That image is useless as it contains no line numbers in it. I mean check the textual output of the image to see if there is preceding whitespace before the imagetype binary as well as any other errors.

Fou-Lu is not looking for part of the code on your backend. He is pointing at whitespace BEFORE you set the header. EG if your full code looks like this:

PHP Code:

1. 2. <?php3. header('bla bla');4. code code5. ?>

it will not work, as you have whitespace outputted before you set your header. As your screenshot only centers around your part of the code, we can not judge whether this is the only code on that page, or whether there is more somewhere which could be influential.

Look at all the whitespace there. Who knows what's above that.
You cannot embed a GD script with the output type as an image into a textual output script. The script's entire purpose is to generate and represent itself as an image. That should look more like this: