Problem returning image to <img src= call.

Hi, friends.

I’m trying to use an on-the-fly thumbnail generator. The call to the php file is like this:

The thumbs.php files takes a filename, maxw and maxh and is supposed to return the image. Here are the last two lines of the thumbs.php file after it does its magic:

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

The problem is that the <img src= call just seems to put the text in the source rather than run the .php file. I’ve tried everything and can’t seem to get it to run the file. In the source, here is an example output:

It’s driving me nuts and I can’t seem to find an answer to this anywhere else on the internet. HELP!!

Is thumb.php in the same folder directory as the page calling it?

Regardless it shouldn’t output this

It should at the very least be a broken image link in html, not plain text.

I’m wondering, how your coding it to write out to the screen…

Do you have a website you can put the example on that I can play with?

I don’t believe that you have to send the header. the gd library has dedicated jpeg functions to create them (if that’s what’s you’re using to do this).

How about post your code so we dont have to guess to help you.

Sponsor our Newsletter | Privacy Policy | Terms of Service