I deleted all cached images and then explored an album or two to see what cached images would be produced. Then I created a set of 'Image cache sizes' to match all that were produced on the fly as a result of my viewing. My goal, of course, was to rely on cached images to the greatest extent possible. And the disk consumption was not an issue, it was ok that many of the cached images would never be used (i.e. producing both portrait and landscape sizes when each image would actually only need one or the other).
That was great until I realized that photos in other albums may have been produced at different X*Y resolutions and would therefore result in additional 'Image cache sizes' needed.
It would be nice, and perhaps quite challenging, to be able to generate the image caches based on the theme and it's current image size settings. IOW, rather than create all possible sizes that might be needed, use the existing setup and the characteristics of each photo in the gallery (or maybe just by album) to predetermine what cache sizes would be needed and produce only those cache files.
This would be particularly useful for those that have many different photo sizes that would result in the need for many slightly different cache file characteristics.
If it is too difficult to predetermine cache file requirements from the perspective of the theme and current configuration, what about the use of a 'hints file' at the gallery or sub-album level that could contain hints for each photo X*Y size. Like:
[5432x3678]
# size,w,h,cw,ch,thumb
,580,387,,,
,40,27,,,thumb
100,,,,,,thumb
[3678x5432]
,387,580,,,
,27,40,,,thumb
100,,,,,,thumb
[2272x1704]
,580,435,,,
,40,30,,,thumb
100,,,,,,thumb
These files could be used in conjunction with each photos X*Y characteristics to determine which 'cached images' should be produced for each photo.
Comments
If a gallery has 10 different X*Y sizes, for example, and the goal is to pre-cache for all, 20 'sets' (10 x the two possible orientations) of images would be produced currently. But 19 of those wouldn't be needed/wanted. Being able to provide the hints would eliminate 95% of the work in this case.
But since this is precaching it is really not possible to set what sizes to cache for what image. It is all or none then.
Technically not necessary to precache anything as Zenphoto will create cached versions on request automatically. For uncached images that will cause a delay for the first visitor but that's it then.
Please also see:
http://www.zenphoto.org/news/caching/
From your description it sounds like your theme is setting its display size based on the image size of the original. Normally this would not be the case, the display size would be a fixed size maybe based on the image orientation, but original size would not be a consideration.
So for most themes, there might be an album thumbnail size, and image thumbnail size, and a image page size. With landscape and portrait orientations that amounts to six sizes of which three would be used.
What code are you using for displaying the images?
I'm using the zenpage theme and it's untouched at this point. I'm just trying to get familiar with things before making mods. I did include several plugins, including a thumbnail slider, and that require yet another set of tinier thumbnails to pre-create.
So for my simple setup it seems I need to pre-create at least 6 cached images for every unique X to Y ratio of the original photos. And finding that I do have more than a few different ratios means lots of needless processing to do the all or nothing pre-cache.
So my feature request (or at this point just questioning) was that if I could pre-identify the cached image sizes needed for each unique X to Y ratio, then this info could be made available to the pre-caching process. And pre-caching would then use that plus each photos actual X*Y & orientation to produce only what would truly be needed for each photo.
The above idea is far from perfect. You still need to first see what actual sizes are needed for a given theme and it's current settings. But that could be done with a tiny sample of files vs. a large photo set (again, with 40k files that would take a while).
I'm using gd to do the rendering. And the zenpage theme doesn't let you predetermine all the sizes it will use. In some cases you can chose the horizontal or vertical but not both. And that's where the slight differences come in.
acrylian: I went to the cacheManager plugin and defined my own group of sizes so that I could just check them off at once. (And I didn't want to mod the one's for the zenpage theme). But are you saying that if I add more cacheManager::addThemeCacheSize() calls to themeoptions.php, that would be the better way to go? I thought it looked liked it would have the same effect.
I do like the fact that zp will cache what's needed when each page and photo is visited. But I'd prefer to have the 'user experience' be as fast as possible. Disk is cheap. But users' attention spans are a bit fickle.
I think it's cool that we _can_ precache. I was just hoping that process could be improved a bit.
The images that are cached may well vary in size depending on their aspect ratios, but only one pre-cache request size is needed since it will apply the same computations as the actual image request would have.
I did find that I needed to add a size (100_thumb) for that zenpage theme. And I also found that it was pre-caching 95_cw94_ch94, but it later used w95_h95_cw95_ch95, instead. So I'm making that change (but I'm scratching my head there).
Definitely the MaxSpace feature is very helpful for my use. (I see that it's not necessarily available/used by default in all themes).
And this is off-topic, but since I switched from pre-caching a rather large number of sizes to accommodate all aspect ratios and am now just going with the defaults (+ 100_thumb), the pre-caching process results in the system powering down (!) after about 30 minutes of pre-caching. (I've repeated this 3 times now). But I've never had any similar power issues before. ... I have a Solaris 11 system with 10 drives attached to 2 SAS controllers plus mirrored boot disks, etc. I think I've reached the tipping point on my 600w power supply. Time to upgrade.
I've still got a lot to learn re: zenphoto. Thanks for your help/guidance and patience.
A lot is optional and can be done via the theme if required.
Regarding the power issues it is most certainly not the power but the memory. Take a look here (but you possibly know that already):
http://www.zenphoto.org/news/problems-with-albums-and-images/