ZenphotoCMS Forum
Find Original Height And Width Of Album Thumbnail - 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: Find Original Height And Width Of Album Thumbnail (/thread-12387.html)



Find Original Height And Width Of Album Thumbnail - Epsilon - 2015-12-19

I need to find the original height/width of the thumbnail image for the current album so that I can work out the images aspect ratio.

I've tried getDefaultHeight/getDefaultWidth but I can't get them to return a value.

I'm guessing I need to pass an image into these functions as no image is selected by default (like they were in my next_image loop) but I can't figure out how to get it working.

Any help would be appreciated.




Find Original Height And Width Of Album Thumbnail - fretzl - 2015-12-19

Something like this ?

`

`




Find Original Height And Width Of Album Thumbnail - acrylian - 2015-12-19

@Epsilon: All on Zenphoto works with the object model framework as the base. Lots of plain template function do directly work if you are in the right context (album, image etc). Outside you most always need to pass an object of the image or album to get a result. `http://www.zenphoto.org/news/zenphotos-object-model-framework

Info on all functions you find here: http://www.zenphoto.org/documentation/elementindex.html
(use the browser page search to find something). Note the difference between normal functions and class methods ;-)

You can also get the size of the full image by using getSizeFullImage($image) where $image must be an image object unless you are on the single image.php page.

There is also isLandscape($image) to find the orientation of the (uncropped) image.




Find Original Height And Width Of Album Thumbnail - Epsilon - 2015-12-20

Exactly what I was looking for, thanks