Page 1 of 1

Imagejpeg output

Posted: Sun May 08, 2011 7:36 pm
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

Re: Imagejpeg output

Posted: Sun May 08, 2011 7:41 pm
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 ?

Re: Imagejpeg output

Posted: Sun May 08, 2011 7:45 pm
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 :?

Re: Imagejpeg output

Posted: Sun May 08, 2011 8:17 pm
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.