getCustomImageURL [line 2150]
Returns the url to the image in that dimensions you define with this function.
Parameters:
int $size: the size of the image to have
int $width: width
int $height: height
int $cropw: cropwidth
int $croph: crop height
int $cropx: crop part x axis
int $cropy: crop part y axis
bool $thumbStandin: set true to inhibit watermarking
Can somebody explain to me what $size means? You can set width and height and that one is confusing me. Thanks
If you set the size to 500 for example zenphoto will use it for the longest side of your picture. So a landscape image will be 500px wide and a portrait one 500 px high. Best you try a little around with that.
If you want to set a max width and an max height so that no image get bigger than lets say 800 x 600 then you could use the new 1.2.1 maxspace functions (search for that on our functions guide).
I'm also looking for a function that returns an image URL specifying a maximum width and a maximum height. The layout I'm working on has a container of fixed dimensions, and I don't want to crop the images. getCustomImageURL() would work with its $size parameter, but I actually want the $width to be no more than 675px, and the $height to not exceed 550px.
?
Try these:
http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functiongetCustomAlbumThumbMaxSpace
http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functiongetCustomSizedImageMaxSpace
http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functionprintCustomAlbumThumbMaxSpace
http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functionprintCustomSizedImageMaxSpace
If you want to use the albumthumb variant you need to use the nightly/svn since the 1.2.1 ones contains some bugs.
You need to get some understanding of PHP syntax. Specifically how function parameters work. In PHP (and most procedural languages) function parameters are positional. That means that, in the case of getCustomImageURL(), the first parameter is the size value, the second is the width, the third is the height, etc.
So, the call you want is getCustomImageURL(NULL, 675, 550). You could also do a search on getCustomImageURL and see how other themes are using it.
Thanks - that's very useful. However getCustomImageURL(NULL, 675, 550) returns a sized image cropped to the given dimensions. What I need is an image that is uncropped but is sized within a maximum width of 675, max height 550 - whichever the image exceeds first. I would expect getCustomSizedImageMaxSpace(675, 550) to work, but it doesn't.