Still finding my feet with Zenphoto, but one feature I really like is the on-the-fly caching. It means that I can load my full-sized image into my gallery, but for displaying a resized version, e.g. in a forum post. I can call it into being simply by linking to it.
E.g. original image:
<website>/albums/<path>/filename.jpg
Resized version:
<website>/cache/<path>/filename_1024.jpg
This creates a resized version that is 1024 pixels wide - it strictly determines the width as far as I can tell, so if the image is taller than it is wide then the height will be greater than 1024. But in the Basic theme, there's an option to use the 'longest side' for resizing. So I'm wondering if there's a syntax or an option that will allow me to specify that the longest side is used in an on-the-fly resize.
Thanks
Comments
[url=<website>/albums/<path>/filename.jpg][img]<website>/cache/<path>/filename_1024.jpg[/img][/url]
so that readers of the forum will see a resized image in the forum post, but when they click on it they are taken to the full sized image. It's not too much of an effort to construct this link manually, but if I could display it alongside the thumbnail in my Basic gallery page that would make life a lot easier. What's the best way to approach this?
If you like to add something to the theme you will have to edit it. I suggest to also review the functions documentation (see the user guide) for image functions. Of course I suggest to read the theming tutorial first to get familar with some theme basics.
I appreciate that it's not the intended use of the cache, but nevertheless it is a really useful feature. If I want to display a downsized image in a forum post I don't need to create it in advance, I simply paste the link to the full image, change '/albums/' for '/cache/' and then type the width suffix just before the .jpg extension. Clearly there are enough 'smarts' in the image processor to extract the width parameter from the filename, but not the cw and ch parameters. Is that right? And even if not, there is no parameter for 'longest side'. I guess I'll stick to resizing via the width.
Thanks for the pointers on editing the theme. I'm a PHP novice, but will take a look.
Btw, there is an older bbcode plugin: http://www.zenphoto.org/news/generate-bbcode/
No idea if that still works but maybe you can adapt it to your needs. Theme editing will be necessary in either case.