PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi!
Need help with imagejpeg() function. It should be outputting image to a file or a browser. Outputting to a file works fine, but when trying to output an image to the browser image is shown as a text(bunch of symbols with header in front). Is there anything that I don`t understand about it? Thanks in advance! Will include my code:
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: :arrow: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Modified my code, but now it outputs nothing.
code:
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: :arrow: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
ImageCreateFromJPEG - GD reads a jpeg image to memory (in its own format, more or less jpeg->gd[memory])
ImageJPEG - gd[memory] -> jpeg[output]
Why? A simple readfile() would suffice.
You cannot send 2,3,x images at once as one response. The browser/client asks for one image und you flood it with ...dozens?
Or is there a special client involved that can seperate those images from the stream?
Thank you for your replies. No, there`s nothing to separate images from the stream. Did I get you right: with a single .php file I will not be able to send all files in a specified folder to a browser?
I have followed all your suggestions and came up with the code that still doesn`t work and does the same as previous ones - outputs symbols instead of image(only one image this time). My code: