I have been reading all kinds of posts about this, including the info about the printCustomSizedImage(getImageTitle(), null, null, 120) etc., but I don't quite understand it yet.
In my albums I will have images (drawings, photographs) in all kinds of dimensions, from square to panorama.
I would like to have a max height for all the thumbs (120, so they can float nicely), but also within a max width. That means most images will actually be 120px high, but a panorama picture would become less than that because it needs to fit inside that max width.
What would be the correct parameters for printCustomSizedImage to achieve this?
Comments
`if(landscape image) {
one size
} else {
other size
}`
Please see the functons guide, we have functions to get the width etc (I don't have the exact names in mind right now).
if (isLandscape()) { printCustomSizedImage(getImageTitle(), null, 190, null); } else { printCustomSizedImage(getImageTitle(), null, null, 120); }
and the result is promising, but as you can see the sizes are not exactly right. Middle bottom is too short, and bottom right is a bit too high.
screenshot
Any idea if this can be done better? Can't think of anything else .
I think I'll put those panorama's inside another album with a custom theme, and the rest I'll keep to a fixed height...
Hope you weren't thinking about a solution yet :=)
`function printCustomSizedImageMaxHeight($maxheight) {
if (getFullWidth() === getFullHeight() OR getDefaultHeight() > $maxheight) {
printCustomSizedImage(getImageTitle(), null, null, $maxheight, null, null, null, null, null, null);
} else {
printDefaultSizedImage(getImageTitle());
}
}`
This actually worked the last time and it even takes care of square image that can become to big. Maybe you want to give that a try.