Imagejpeg output

Ask about a PHP problem here.
Post Reply
User avatar
EcazS
Posts: 789
Joined: Fri May 06, 2011 5:29 pm

Imagejpeg output

Post by EcazS »

Can I use Imagejpeg or something similar to output an image without setting the header to image/jpeg but not saving the image.
I know if you fill in the second parameter it saves the image but I don't wanna save it just output it
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: Imagejpeg output

Post by jacek »

You have to tell the browser that you are outputting an image, that's what the header is for.

why would you wan to omit it ?
Image
User avatar
EcazS
Posts: 789
Joined: Fri May 06, 2011 5:29 pm

Re: Imagejpeg output

Post by EcazS »

jacek wrote: why would you wan to omit it ?
Omit the header?
Because the html isn't working with it. And I've just been saving the image and then getting the filename and outputting it in an img. Now I wanna output it without actually saving the image :?
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: Imagejpeg output

Post by jacek »

You cant output raw image data and html on the same page. It would be like opening an image in notepad typing html in there and expecting the browser to work it out.

you can use a "data url" (google) but not for IE 7 or below I think.
Image
Post Reply