fixed height thumbnails with bespoke class for landscape and

I am trying to get a fixed height for my thumbnails plus add a different class for syling purposes to landscape and portrait thumbs ( similar request as this old post)
http://www.zenphoto.org/support/topic.php?id=3009#post-17980

I have tried using islandscape and maxthumb in various configurations and can't get the syntax right.
Does anyone have something similar to this for the latest version of zenphoto
______
if landscape
set height to 200px and add the style class of 'landscape'
if portrait
set height to 200px (same height as landscape) and style class of 'portrait'
Am I missing something really obvious?
Any guidance much appreciated.

Comments

  • acrylian Administrator, Developer
    For fixed height/widths within w x h you can use the set of maxspace functions. What is the exact code you are using?

    We have `isLandscape()` to check for landscape images.
  • Hi
    Acrylian, thank you for getting back to me on this.
    I have at this point
    if(isLandscape()) {
    <?php printCustomSizedImageThumbMaxSpace('',300,100,null,null,true); ?>
    } else {
    <?php printCustomSizedImageThumbMaxSpace('',100,300,null,null,true); ?>
    }

    Anywhere near?
    thanks!
  • ( sizes are just sample to check if it works)
    I actually want 200 height and auto width but I want to be able to apply a class to each thumb for spacing.
    so more like

    <?php printCustomSizedImageThumbMaxSpace('',300,100,null,landscape,true); ?>
    } else {
    <?php printCustomSizedImageThumbMaxSpace('',100,300,null,portrait,true); ?>
    }

    ?
  • acrylian Administrator, Developer
    Generally that is correct regarding the landscape (please think of escaping code examples using `backticks`).

    "auto width" is no concept the image processor knows of. It needs concrete values. The maxspace functions are meant to define a max width and max height "box" no image no matter what orientation it has exceeds. So `printCustomSizedImageThumbMaxSpace('',100,300,null,portrait,true);` means no image gets higher OR wider than the max width/height. IMHO the landscape check is not neeeded.
  • HI Acrylian

    Great thank you. I now have image thumbs with maxspace.

    I was also trying to get this on albums and used printCustomAlbumThumbMaxSpace

    One thing ( i am not sure how to describe this so it makes sense?) I also want to add a class with different padding and margins for portrait and landscape but can't get the if statement to work.
    '<?php if(isLandscape())) { ?>
    <?php printCustomSizedImageThumbMaxSpace('',100,300,landscapesytle,null,true); ?>
    <?php } else { ?>
    change to portrait css
    <?php } // end ?>'

    I think this may not be working as it is inside another if/while and while and
    '<?php endwhile; ?>'

    Is there some other method of adding a different CSS class to landscape and portrait.? Am I overcomplicating this?
    BTW... thanks so much again for your help.
  • acrylian Administrator, Developer
    You are doing it correctly, except that the class name should be within quotes (strings always must) and there is one bracket too much in the if (you should get an error on that, unless it is just a typo here).
    It does not matter that it is within the while loop (next_image I assume).
  • That was it. I missed the extra bracket and the quotes. Thank YOU!
    I have one last thing tripping me up.
    Is there a quick fix to add the title="(getImageTitle()," to the image tag. I have it for alt="" but require it for the title?
    The bespoke theme uses jquery and requires the title in the image to work.

    <?php if(isLandscape()) { ?>
    <?php printCustomSizedImageThumbMaxSpace(getImageTitle(),320,200,'landscapesytle',10,true); ?>
    <?php } else { ?>
    <?php printCustomSizedImageThumbMaxSpace(getImageTitle(),320,200,'portraitsytle',20,true); ?>
    <?php } // end ?>
  • that did it.. smashin! thank you..
Sign In or Register to comment.