Member
Member
Epsilon   2015-12-19, 01:49
#1

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.

Administrator
Administrator
fretzl   2015-12-19, 10:17
#2

Something like this ?

`

`

Administrator
Administrator
acrylian   2015-12-19, 10:29
#3

@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.

Member
Member
Epsilon   2015-12-20, 21:00
#4

Exactly what I was looking for, thanks

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.