Problem with thumbnails size

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ésert

Could you tell me how I can do this ?

Thanks for your answer
Sincerely

Comments

  • is it good to recommend something that does not currently work, I know you said it has bugs.

    There are no news on the CustomAlbumThumbMaxSpace are there?
  • acrylian Administrator, Developer
    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
  • Thanks, but I've find the solution this morning, I've use the function printCustomSizedImageMaxSpace, but not the nightly.

    It looks to work very well.

    Thanks:-)
  • Hmm, I thought I was up to date on changes.

    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); ?>`
  • I changed to

    `" 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.
  • acrylian Administrator, Developer
    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?
  • acrylian Administrator, Developer
    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..:-)
  • Great. Now its only the video thumb as stated above and the Encoding for International Characters, then I am all set for the time being. I am looking forward to hear about the charset as that is the only thing holding putting the web pages up for the public.
Sign In or Register to comment.