Hugo

(solved) Image width and height

Hi!
I would like to know the image dimension to know weather to apply portrait or landscape style on it, my images are accessible through image bundle, but I see only image processing functions…

Hi!

You can use something like this:

{{ if ge $image.Height $image.Width }}
    {{ $class = "portrait-image" }}
{{ end }}

Greetings!

4 Likes

Oh, i did not seen it has these properties! Thanks a lot!