423,321 Members | 1,167 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 423,321 IT Pros & Developers. It's quick & easy.

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

P: n/a
hi,

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?

Jun 29 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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.
Jun 29 '07 #2

P: n/a
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
}
Jun 29 '07 #3

P: n/a
shotokan99 wrote:
hi,

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?
Every time you unlock a door, do you get a new key made? If the lock
doesn't change, of course you don't. But if the lock changed every
time, you would have to.

If the image is static, then just generate it once and save it. But if
the image is dynamic, then you need to generate it every time.

Most of the dynamic creation I've seen are things like CAPTCHA, graphs
dependent on changing data, etc.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jun 29 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.