Answers.Body: <p>How about just using the <code>getHeight()</code> and <code>getWidth()</code> methods available on the <a href="http://buildwithcraft.com/docs/templating/assetfilemodel">AssetFileModel</a>? Something like this:</p>
  
  <pre><code>{% set myImage = entry.imagesField.first %}
  
  {% if myImage.getWidth() &lt; myImage.getHeight() %}
    {# portrait #}
  {% elseif myImage.getWidth() &gt; myImage.getHeight() %}
    {# landscape #}
  {% else %}
    {# square #}
  {% endif %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-08-06T12:54:54.303Z
Answers.Text: Seems like that’s it. Somehow i must have overlooked those. Gonna try this. Thanks!
Answers.UserDisplayName: Marcus Scheller
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-08-06T12:57:52.870Z
Answers.Text: No problem, happy to help :)
Answers.UserDisplayName: Josh Angell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-08-06T12:33:13.573Z
Answers.LastActivityDate: 2014-08-06T12:33:13.573Z
Answers.UserDisplayName: Josh Angell
Body: <p>In a current project we will list entries in a masonry-style grid view where the entry’s respective cover image should be styled differently based on their image format. Landscape vs. portrait and -- of course -- square.</p>
  
  <p>I haven’t found anything on here or in the docs pointing to a possible way of doing this.</p>
  
Tags: <assets><format><image>
Title: Is there a way to find out if images (assets) are landscape or portrait?
ThreadText: # Is there a way to find out if images (assets) are landscape or portrait?
  
  (Asked by: username_0 on 2014-08-06)
  
  In a current project we will list entries in a masonry-style grid view where the entry’s respective cover image should be styled differently based on their image format. Landscape vs. portrait and -- of course -- square.
  
  I haven’t found anything on here or in the docs pointing to a possible way of doing this.
  
  **Tags:** assets, format, image
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2014-08-06. Score: 11 | Accepted answer
  
  How about just using the `getHeight()` and `getWidth()` methods available on the [AssetFileModel](http://buildwithcraft.com/docs/templating/assetfilemodel)? Something like this:
  
  ```
  {% set myImage = entry.imagesField.first %}
  
  {% if myImage.getWidth() < myImage.getHeight() %}
    {# portrait #}
  {% elseif myImage.getWidth() > myImage.getHeight() %}
    {# landscape #}
  {% else %}
    {# square #}
  {% endif %}
  
  ```
  
  > **Comments:**
  > **username_0**: Seems like that’s it. Somehow i must have overlooked those. Gonna try this. Thanks!  
  > **username_1**: No problem, happy to help :)  
  
  ---
  
  