Answers.Body: <p>Something like this should work:</p>
  
  <pre><code>{% set totalWidth = 0 %}
  
  {% for asset in myAssetList %}
      {% set totalWidth = totalWidth + asset.width %}
  {% endfor %}
  
  {% if totalWidth &gt; 750 %}
      Do this.
  {% else %}
      Do that.
  {% endif %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-11-21T19:35:56.593Z
Answers.LastActivityDate: 2014-11-21T19:35:56.593Z
Answers.UserDisplayName: Brad Bell
Body: <p>How can I check if multiple asset image widths combined are wider than X?
  So how do i get X?</p>
  
  <p>Like this:</p>
  
  <p>File 1 = 300px wide<br />
  File 2 = 200px wide<br />
  File 3 = 250px wide<br /></p>
  
  <pre><code>x &gt;= 750px than&lt;br /&gt;
    Do This&lt;br /&gt;&lt;br /&gt;
  else&lt;br /&gt;
    Do that&lt;br /&gt;
  </code></pre>
  
Tags: <assets><image-transforms><image>
Title: Combine image assets widths to get total width
ThreadText: # Combine image assets widths to get total width
  
  (Asked by: username_0 on 2014-11-21)
  
  How can I check if multiple asset image widths combined are wider than X?
  So how do i get X?
  
  Like this:
  
  File 1 = 300px wide  
  File 2 = 200px wide  
  File 3 = 250px wide
  
  ```
  x >= 750px than<br />
    Do This<br /><br />
  else<br />
    Do that<br />
  
  ```
  
  **Tags:** assets, image-transforms, image
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2014-11-21. Score: 2 | Accepted answer
  
  Something like this should work:
  
  ```
  {% set totalWidth = 0 %}
  
  {% for asset in myAssetList %}
      {% set totalWidth = totalWidth + asset.width %}
  {% endfor %}
  
  {% if totalWidth > 750 %}
      Do this.
  {% else %}
      Do that.
  {% endif %}
  
  ```
  
  
  ---
  
  