Bulk images creation

images php coding issues or problems here.

Moderators: macek, egami, gesf

shlomi
New php-forum User
New php-forum User
Posts: 2
Joined: Mon May 16, 2011 2:30 am

Bulk images creation

Postby shlomi » Mon May 16, 2011 2:37 am

hi.

i have an app that render lot of images in one process, due to some reasons i can't use C++ for that so i need to do that with PHP-GD.

i have couple of performance questions:
1. what's faster: to create image, save it and then destroy or to create all of the images and finally save and destroy them?
2. how much images PHP can hold without destroy them by imagedestroy()?

thanks.

Shlomi.

User avatar
egami
php-forum GURU
php-forum GURU
Posts: 2196
Joined: Wed Oct 06, 2010 11:19 am
Location: Happy Valley, UT

Re: Bulk images creation

Postby egami » Mon May 16, 2011 8:40 am

1. Better to create, save and destroy.
2. That depends on how large the memory attribute is set to in your php.ini

shlomi
New php-forum User
New php-forum User
Posts: 2
Joined: Mon May 16, 2011 2:30 am

Re: Bulk images creation

Postby shlomi » Mon May 16, 2011 12:50 pm

egami wrote:1. Better to create, save and destroy.


why? let's say i have 100 images and i need to draw something (or maybe couple of things) in each one of them, it's not better to make the changes on all of the images (and meantime save them into some data structure, array etc) and then save and destroy them all? the main point is that maybe i'll need to draw twice or more on the same image, so 'buffer' the image into the array will be efficient-est then load it again from the hard drive. am i right?


Return to “PHP coding => Images”

Who is online

Users browsing this forum: No registered users and 1 guest

cron