[ansel] Thumbnail generation for gallery uploaded via publish this photo to the web.

Michael Rubinsky mrubinsk at horde.org
Mon Nov 17 18:45:27 UTC 2008


Quoting gimili <gimili17 at gmail.com>:

> Jan Schneider wrote:
>> Zitat von gimili <gimili17 at gmail.com>:
>>> Would it be possible to have a cron job that created the  
>>> thumbnails for a large gallery that was uploaded via web publish  
>>> or perhaps a button that ran a script?  This seems like it might  
>>> be simple and perhaps people would find it useful?  It is so easy  
>>> to get a large amount of photos into ansel via web publish but  
>>> then it was slow to move through the pages as I had to wait for  
>>> the thumbnails to be generated for the first time.  Once they are  
>>> generated it is almost instantaneous.  Not that big a deal but  
>>> just a thought.  This is a really great module!  Thanks!
>> Why would a cron job help in that case? You'd still have to wait,  
>> but this time for the cron job, not for the page to load.
> Quite true Jan.  I would have to wait but cron job happens without  
> me having to do anything.  Currently I have to move through each  
> page myself to force generation and this takes some time (perhaps  
> there is already a better way that I am not aware of?).  It took 20  
> seconds per page with 2,400kb photos.  With cron I could upload the  
> large gallery (I still can't believe how well this works) and know  
> that in the evening the thumbnails would be generated so that the  
> next day my user, who always complains about speed, would not have  
> to wait as she switches from page to page in the gallery for  
> thumbnail generation.

...but then that means that "your user" would have to wait until the  
next day, after the cron job has run.  There is also nothing  
preventing someone from visiting your gallery, thus generating the  
thumbnails anyway. There is an option to auto-generate thumbnails on  
upload, but this is purposefully turned off for the xp publish feature  
to avoid overloading the server since there is no limit on the number  
of photos that can be uploaded at once via that method.

Image generation is fairly resource intensive, spreading it out in  
groups of 9 images (or whatever your images-per-page setting is) helps  
spread out the load.  That being said, 20 seconds seems a bit  
excessive, but that, of course, depends on lots of factors, server  
hardware/memory, image toolkit being used etc...

Running a cron job isn't a horrible idea, but that comes with it's own  
set of performance issues since it would be checking every user's  
galleries for un-processed images and processing them and *that* would  
be seriously resource intensive for anything but the simplest  
installations...then there is the question of what style should the  
thumbnails be auto generated for....etc...


> There is already an option for auto-generation for pictures uploaded  
> via the ansel interface but this is not available for the web  
> publish option.  Maybe there is another way to trigger it besides  
> cron.  A button that generates all the thumbnails for the gallery  
> would help.

If your having so much issues with one page in your gallery, I'm not  
sure that generating an entire gallery's worth during a single request  
would be the answer. I'd be against this being available for all users  
since it has the potential to affect server performance.



Thanks,
mike

--
The Horde Project (www.horde.org)
mrubinsk at horde.org

"Time just hates me. That's why it made me an adult." - Josh Joplin


More information about the ansel mailing list