I want to control the display of images with the PHP GD library -- I am going to add some text to the bottom corner of it on the fly when a browser requests the image, rather than saving the text into the image.
I know that I can do this: set the MIME type in the header and then call imagepng(...)
with the filename to just display the image to the browser, but how would I embed it in a document? Like,
<img src='somefile.php?i=1' ... />
do I just call imagepng
with the filename but without setting the headers?
Also, if someone copies the image source out of the source code and navigates to it in the browser... what will happen if the headers aren't set? Will the image display as if the actual image was requested?