PHP create image functions

Status
Not open for further replies.

Rob_C

Member
Messages
34
Reaction score
0
Points
6
I am working on a script that uses the image functions to generate an image. The functions are: imagecreatefromstring, imagecreatetruecolor, imagecopyresampled, and imagepng.

I noticed in my local testing that when calling these functions for a list the cpu usage goes up. Will this cause a cpu resource usage problem for my account?
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Would probably depend on a) the size of the image and b) the number of such requests per page.
Many CAPTCHA plugins create smaller images and I have not had a problem with CPU usage on x10hosting with them.
 

Rob_C

Member
Messages
34
Reaction score
0
Points
6
Right now its setup to return a thumbnail image of 240x180 for 15 items per page. And also a bigger image on the view item page at 800x600.
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Why not create the thumbnails separately and store them? Or use a caching routine as part of the script so you don't churn out the same image repeatedly?

Or are these images created on the fly?
 

Rob_C

Member
Messages
34
Reaction score
0
Points
6
Yes, they are created on the fly. The create function is initiated for each element in the list. I do not want to store them because of the terms of service. I'm not sure if that is allowed.

I'll see about the caching routine.
 
Status
Not open for further replies.
Top