Hi
First, I'm french and my english is really poor so excuse me in advance ;-)
So,
For the gallery of my website I use the new 1.2.1 version of zenhoto
In this gallery, I’ve got several picture sizes and lots of panoramics.
.
The default thumbnails size and scale is 120, so the size of my common pictures thumbmails is 120180 or 180120.
But I’ve got a problem with the proportions of my panoramic pictures. Indeed, a panoramic of 120px high is arround 400px in width and I would like them to be displayed in a max witdh format of 180px.
So I would like to know if it is possible to configure the MAXIMUM dimension of thumbnails or to resize by the longest size rather than by the shortest size like now.
I have seen a website where thumbnails are configured as I would: http://www.boutsdeplanete.com/portfolio/page/search/le_d%C3%A9sert
Could you tell me how I can do this ?
Thanks for your answer
Sincerely
You need to use the nightly build (they are in 1.2.1 already but with bugs) and use these functions:
http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functiongetCustomAlbumThumbMaxSpace
http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functionprintCustomAlbumThumbMaxSpace
http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functiongetCustomSizedImageMaxSpace
http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functionprintCustomSizedImageMaxHeight
Yes, that's why I recommended the latest nightly..:-) sbillard has helped out with that recently [svn 2773] and hopefully solved the remaining bugs.
Btw, if you are really waiting for something you could also check here yourself what has been done:
http://www.zenphoto.org/trac/log/trunk
I changed to
">
and for some odd reason it seems to work better... but its still not 100% and its kind of random as before.
EDIT: and it seems the problem is now Only on vertical photos. As for as my testing has gone anyways. Not like just a random every image as before.
You use the right code... Ahrg, these functions are really starting to cause headache...:-(
I don't see the connection the the quotes around the title... We reworked that function completly twice...I am running out of ideas.. Maybe you could try to help by looking at the functions itself?
I have played around with the code in the template-functions.php for almost 2 hours now.. Always this random thumb error. I recon this has to be somewhere else then in the function printCustomAlbumThumbMaxSpace
and yeah of course mentioning that the problem is the same with video files as it was before.
I think I cracked it.
Change template-functions.php
Line 1309-1323
From
function printCustomAlbumThumbMaxSpace($alt='', $width=NULL, $height=NULL, $class=NULL, $id=NULL) { global $_zp_current_album; $destshape = $width > $height; $albumthumb = $_zp_current_album->getAlbumThumbImage(); $sourceshape = $albumthumb->get('width') > $albumthumb->get('height'); if ($sourceshape == $destshape) { // the soruce and destination orientations are the same printCustomAlbumThumbImage($alt, min($width, $height), NULL, NULL, NULL, NULL, NULL, NULL, $class, $id); } else{ if ($sourceshape > $destshape) { // landscape to portrait, width is constrained printCustomAlbumThumbImage($alt, NULL, $width, NULL, NULL, NULL, NULL, NULL, $class, $id); } else { // portrait to landscape, height is constrained printCustomAlbumThumbImage($alt, NULL, NULL, $height, NULL, NULL, NULL, NULL, $class, $id); } } }
to
function printCustomAlbumThumbMaxSpace($alt='', $width=NULL, $height=NULL, $class=NULL, $id=NULL) { global $_zp_current_album; $sourcew = $width > $height; $sourceh = $height > $width; if ($sourcew == $sourceh) { // the soruce and destination orientations are the same printCustomAlbumThumbImage($alt, min($width, $height), NULL, NULL, NULL, NULL, NULL, NULL, $class, $id); } else{ if ($sourcew > $sourceh) { // landscape to portrait, width is constrained printCustomAlbumThumbImage($alt, NULL, $width, NULL, NULL, NULL, NULL, NULL, $class, $id); } else { // portrait to landscape, height is constrained printCustomAlbumThumbImage($alt, NULL, NULL, $height, NULL, NULL, NULL, NULL, $class, $id); } } }
EDIT: did some minor tweaks.
EDIT: and of course global $_zp_current_album; shouldn't be needed there any more as well
EDIT: Can it really be this easy?
Oh great, thanks for looking into that! We will take a further look at that. But if it works for you that's great.
Sorry that I forgot to mention about the missing videothumb, we have that not in there because they are a little separate from the normal (also there are some issue with that in general because of the mentioned custom crop feature). I promise they will return once the general function is approved..:-)