ZenphotoCMS Forum
resize thumbnail, max height - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: resize thumbnail, max height (/thread-2329.html)



resize thumbnail, max height - zanderography - 04-03-2008

I'm assuming this needs to be done somewhere in i.php or with a custom function... I'd like to be able to restrict the height of the thumbnails to one size so that landscape and portrait images can all line up evenly in one row on the album view. I don't like the idea of cropping the images. I just want to set a 'maxheight' variable (which would then apply to the short side of a landscape image) and have all thumbnails proportionally resize down. Any ideas?




resize thumbnail, max height - acrylian - 04-03-2008

Try this: http://www.zenphoto.org/documentation/zenphoto/_template-functions.php.html#functionprintCustomSizedImageMaxHeight

It's meant for the sized image originally though, but you could duplicate this function and make a custom function for your theme from it.




resize thumbnail, max height - zanderography - 04-03-2008

Perfect, thank you.




resize thumbnail, max height - zanderography - 04-03-2008

Is there a reason why that works on album.php but not search.php (of the modified default template?)?

I get this error: Fatal error: Call to a member function on a non-object.




resize thumbnail, max height - sbillard - 05-03-2008

The function assumes that there is an album from which the image came from. However, in a search that is not the case.




resize thumbnail, max height - BertSimons - 05-03-2008

isnt it so that even in search there's an album from which the image came from?...
on my search page I get the album from which the image came by putting

`global $_zp_current_image;

$album = $_zp_current_image->getAlbum();

$albumtitle = $album->getTitle();`

in the `` loop;

no idea if this can be of help though




resize thumbnail, max height - BertSimons - 05-03-2008

and defining the max height like `