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 120*180 or 180*120.
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ésertCould you tell me how I can do this ?
Thanks for your answer
Sincerely
Comments
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
There are no news on the CustomAlbumThumbMaxSpace are there?
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
It looks to work very well.
Thanks:-)
I put up [2795] and I am getting no change what so ever, the same identical bug.
I have changed so much.. I just want to make 100% sure I am using the right code.
`" title="<?php echo gettext('View album:'); ?> <?php echo getBareAlbumTitle();?>"><?php printCustomAlbumThumbMaxSpace(getAlbumTitle(),200,200); ?>`
`" title="<?php echo gettext('View album:'); ?> <?php echo getBareAlbumTitle();?>"><?php printCustomAlbumThumbMaxSpace('getAlbumTitle()','200','200'); ?>`
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.
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?
and yeah of course mentioning that the problem is the same with video files as it was before.
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?
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..:-)