Re: php generated images vs image file...which is better?



peter wrote:
shall we say you want to creae a banner, a button, and other images
for your site. some create images on the fly through php using gd
library. is this more advisable or more efficient compared to creating
an image file (.jpg) shall we say using photoshop?

If there is no reason to create the images on the fly then a hard copy of the image is always the best option. If you create images on the fly then php will have to create the image everytime it is requested which wastes server resources.


Yup and if you must create images in the fly for whatever reason atleast cache the images that you have made

if(file_exists($img))
{
// include image
}
else
{
//create image
/ cache image
}
.


Quantcast