I think I don't know what the option is for, actually.
What I want to do is to limit all images that are uploaded so that no image is wider than, say 600 px . How do I do that? The "Image size" option in Options > "image display" seems to have no effect on the images. I want them to be at most 600 px wide when the visitor clicks them and the lightbox appears.
Thanks for your reply, acrylian!
I understand that changing that line will take the resized image and display it instead of the original large one.
Unfortunately, it seems I have no resized images... changing that line caused my lightbox (slimbox to not find the image.
In the album folder, there is only the original (large size) image and no resized image. I only have one image upploaded in that album.
I wonder why my zenphoto doesn't resize the images that I upload...? I have set [i]"Protect full image"[/i] to false and [i]"Full image download"[/i] to false.
Sorry, I didn't test the above solution and made just a quick guess. Indeed that seems not to work...
Zenphoto does resize images for the thumbs and the sized image that is only used if you use the image.php page (which this theme does not do) and someone visits the image or if you use the precache buttons in the admin.
If you want to use the simple+ theme without modifing you would have to resize your images before uploading.
If slimbox is able to open pages (thickbox can for example), you could call the image.php you would have to create one for the theme by modifying one from default theme for example first with this:
without mod_rewrite: zenphoto/index.php?album=&image=
with mod_rewrite: zenphoto// +mod-rewrite suffix set in options.
Please take a look at default theme for example.
Sorry, I know nothing of mod_rewrite as I don't use an Apache server. Also, iframes are deprecated, even if it's in a slimbox I don't like the solution.
I have a better idea. Is there a way to retrieve the cached (resized) image URL? You mentioned getSizedImageURL(595) but that didn't work (empty output). What if I could get the URL to the cached resized image? Like zenphoto/cached/album__image.jpg_595.jpg ? Then I could just make sure to cache the images I upload?
Maybe I can even take that cache function (that image.php must be using) and call it from album.php to make it cache automatically?
If you precache the images in the admin you should get images like that above mentioned. Actually getSizeImageURL()should get the url to that image (if the values within the brackets is left empty the size set in the options is taken).
Any you can called that directly, too: zenphoto/zp-core/i.php?a=&i=&s=
instead of "zenphoto" and "zp-core" you could use the constants WEBPATH and ZENFOLDER.
O-kay... then you have another version of zenphoto than me, 'cause in my template-functions.php the getSizedImageURL is defined like this:
`function getSizedImageURL($size) {
getCustomImageURL($size);
}`
An optional parameter had been like function getSizedImageURL($size = 0) { }
Shame on me, I indeed confused it with getDefaultSizedImage() (we have too many functions, that happens if you answer inbetween...:-)). But you could use getSizedImageURL()with the option setting of the admin with this getSizedImageURL(getOption("image_size"))
Please take a look at our functions guide, too.
Ok, try getSizeDefaultImage() http://www.zenphoto.org/documentation/zenphoto/_template-functions.php.html#functiongetSizeDefaultImage
in combination with getDefaultSizedImage() http://www.zenphoto.org/documentation/zenphoto/_template-functions.php.html#functiongetDefaultSizedImage
Yes, getDefaultSizedImage() worked! Thanks a bunch!
Now I've modified my Simple+ theme to work with PHP safe_mode On and displaying the cached image from the albums instead of the original ones. It seems to be caching the images automagically too.
A last question for you; will I have to cache any images that I upload now? I just tried uploading an image and directly checking it out in the gallery, without precaching, and it worked fine. Will this fix stay in effect and work in the long run? Is it a huge server burden or won't work with uploading zip archives or anything like that?
zenphoto always caches automatically once if someone visits an image the first time (both thumbs and the sized image). If you don't change the size in the options for thumbs or the size image, nothing more will happen.
Additionally you have the option to cache manually either all images (on overview in the admin) or for each album individually (on the album's edit page in the admin).