Member
Member
ela002   2008-10-02, 08:00
#1
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
Administrator
Administrator
acrylian   2008-10-02, 09:07
#2
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).
Member
Member
ela002   2008-10-06, 19:55
#3
I tried maxspace but it doesn't return url to the photo it's loading as a thumbnail to the existing web page.

Anyone that can help please, I am trying to get a resized photo at specific resolution, not cropped one.

Thanks
Administrator
Administrator
acrylian   2008-10-07, 08:41
#4
Please try tonight's nightly. There was a bug in the maxspace functions.
Member
Member
ela002   2008-10-07, 16:47
#5
It returns a string "Array" not a url like getCustomImageURL but I think you mean to try zenphoto-2008-10-07-trunk which is not out yet Wink
Member
Member
ela002   2008-10-07, 17:20
#6
I have updated to latest source code I still got problems.
Administrator
Administrator
acrylian   2008-10-08, 09:20
#7
The "array" problem or what?
Member
Member
amucklow   2008-11-16, 21:34
#8
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.

?
Administrator
Administrator
acrylian   2008-11-16, 21:51
#9
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.
Member
Member
amucklow   2008-11-17, 21:31
#10
Thanks. It's the custom sized image variants I'm interested in, because the thumbs will stay the same size.

I'm using a galleria / zenphoto theme with the action taking place on `album.php`. Here's my code for the loop:

`
<?php while (next_image(false, $firstPageImages)): ?>
<li<?php if($isfirst){echo ' class="active"';$isfirst=false;}?>>"><?php printImageThumb(getImageDesc(),getImageTitle()); ?></li>
<?php endwhile; ?>
`
Replacing `getCustomImageURL(500)` with `getCustomSizedImageMaxSpace($width=675, $height=550)` is what I understand should work, but it isn't - neither the custom sized images nor the thumbs load. Am I doing something wrong?

I guess one solution is to size each image exactly and use `getFullImageURL()`.
Member
Member
sbillard   2008-11-17, 22:53
#11
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.
Member
Member
amucklow   2008-11-18, 22:25
#12
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.
Member
Member
sbillard   2008-11-18, 23:14
#13
There appears to be an error in `getCustomSizedImageMaxSpace()` check tonight's build for a fix.
Member
Member
amucklow   2008-11-19, 12:47
#14
OK thanks. I assume I just need to download template-functions.php from the trunk...
Administrator
Administrator
acrylian   2008-11-19, 14:15
#15
Once again: It is strongly recommended never to install single files from the trunk/svn but to do a complete install. Zenphoto files depend on each other.
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.