All.
I have been playing with zenphoto for quite a while and I think it's simply the best around.
I have set up a fairly large private gallery on a very small server at home. I have several 1000's of photos there, and the thumbnail/cache generation is taking far too long on my poor little server. (It being small is not an issue since I will have a max of 2 clients connected at the same time).
What I would like to do is create the thumbnails / cache manually on the command line instead of having the overhead of Apache/PHP/etc creating them.
I have had a (very) brief look at the code, but I can not figure out if the code depends on anything else than the filename in the cache directory. Does it expect certain attributes like quality or timestamps? (or anything else for that matter). The size of the thumbnail is obviously a fixed requirement.
Have anyone else done something like this before? If so, do you still have script/command snippets hanging around?
Any hints, tips or examples would be greatly appreciated.
PS. I am planning to set up some sort of semi-automated release system where photos from the above gallery is "released" (pushed) out to my public server when äuthorised. This server is well fast enough, but if I could find a way to not have to re-generate the cache it would make the automation a lot smoother.
Thanks in advance.
Tor
Comments
(I'm thinking maybe making a function out of the contents of i.php, and calling it on each image but only displaying, say, a progress dot instead of downloading each image. I could also call this on upload.)
Due to my "unique" situation I was just wondering if there are any way I can manually create these myself. I am an old-school unix sysadmin, and I am more comfortable on the command line.
Does the application have any dependencies on how the images are created? Could I simply use the convert utility that is part of ImageMagick to convert them to a smaller size?
I am not trying to dis the pre-cache functionality, but in some cases you may want to optimise the cache creation process a bit. At this point in time it is simply because my server is not really able for it (I could divide them into sub-albums, but that is too much of manual labour for me).
This also holds true to a certain extent when I in the not so distant future want to send large parts of my images in my gallery to my co-lo server. I don't really want to spend days pre-caching thousands of images manually before I can use it. Not only because of the time and effort involved, but also due to the bandwith involved (as jlang elegantly mentions above).
I would like to create some sort of script that will walk through my gallery directories and creates the cache images.
I will try to have a go at reading the code, and then test if this can be done. I will try to respond with my progress (If any).
Also, it's possible to make the same request through a browser *without* downloading each image. It would require a change to `i.php` to return a simple text response when the image generation is complete for the requested image. The requesting HTML page would request images via JavaScript and display progress as it finishes, but no images would be downloaded.
Both of these methods would be fun to write... I may give them a shot. tbendiksen, if you make any progress keep us posted.
tbendiksen's issue is slightly different - if the server is too slow or can't handle the resize, not downloading the results won't really make any difference. Imagemagick may be more efficient than the php libraries.
My particular case is probably a not very common one, so I will look into the ImageMagick route.
I do really believe that replacing the images with either text or a small static image would be very beneficial. Also in my secondary case described above where I will transfer a lot of images to a new server. While this server is fast it will take a lot of bandwith to cache the images.
Thanks everyone for the input. If I come up with anything usable I will post back.
--
Tor