I'm still working on creating slideshows with custom sized images.
I'm passing a variable into the slideshow functionality, so this accomplishes the basics. But I've learned that this variable (&imagesize) only controls the width. This is a bummer since portrait photos are then too tall.
So I've been playing around with this line of code:
$img = WEBPATH . '/' . ZENFOLDER . '/i.php?a=' . urlencode($image->album->name) . '&i=' . urlencode($filename) . '&s=' . $imagesize;
If I nix the '&s=' stuff and use '&h=' instead, I can restrict the height of the photos. This is closer, but I've now lost the ability to restrict the width.
I've played around with all of the following, including combinations:
&s=
&w=
&h=
Depending on the combination, cropping kicks in. Not the desired effect.
I simply want a photo to be scaled down until it's width is equal to or less than a certain number AND its height is equal to or less than another number, with NO cropping.
Any way to do this? Are there other variables that I can use above? (I couldn't find documentation of this anywhere, but it probably exists - I just don't know where to look.) Or is there a &x= where x will force it to NOT crop?
Thanks in advance!
Comments
So the next possible solution involves checking the image height and width BEFORE making the size calculation. I do this on the image page, but it seems those functions are not available from within the slideshow environment.
Is there any way to get the dimensions of the original image from within the slideshow environment?
"The normal functions do not work since we are outside of any album/image context on the slideshow. Generally it is possible, but that is not really easy because of all the javascript stuff for preloading involved. Having generally the option to set a widht and height for Zenphoto images is on my list, but I am lacking time currently to get to it."
For example, unless I'm missing something, functions like getFullHeight and getFullWidth don't work in the slideshow environment because we are outside the album/image context. So I'm trying to figure out how to obtain each images height and width before I size it.
Regarding the implementation of width / height in general, we decided to make separate functions for themes to not break themes. Also this would have needed too much changes in the core. So there are no admin options. These are now available in the nightly (not in the documentation yet):
`getCustomAlbumThumbMaxSpace(), printCustomAlbumThumbMaxSpace(), getCustomSizedImageMaxSpace(), printtCustomSizedImageMaxSpace()`. These of course won't work in the slideshow, too, because of the missing context.