Answers.Body: <p>Aha!!! Got it working at last!!</p>
  
  <p>As I was using Live Preview, even though I was set to Dev Mode for any errors, they weren't showing in the Live Preview pane <em>(maybe that should be a feature request?)</em>.</p>
  
  <p>As soon as I tested it out on the live page I saw an error and it told me to place parentheses around an expression so I did this instead :</p>
  
  <p><strong>quality: (block.quality.value)</strong> and all is good with the world now!! :-)</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-13T22:54:24.603Z
Answers.LastActivityDate: 2015-05-13T22:54:24.603Z
Answers.UserDisplayName: Mark Bowen
Body: <p>Hope I'm not posting incorrectly here but don't have enough reputation yet <em>(really don't understand that system at all)</em> to be able to comment on another post here on the exchange.</p>
  
  <p>Original Post - <a href="https://craftcms.stackexchange.com/questions/6783/inline-image-transforms">inline image transforms</a></p>
  
  <p>I'd like to get this to work but not having any luck at all. This is my code in my template so far.</p>
  
  <pre><code>{% for block in entry.matrixBlocks %}
  
      {% if block.type == "text" %}
  
      &lt;p&gt;{{ block.text }}&lt;/p&gt;
  
      {% elseif block.type == "quote" %}
  
      &lt;blockquote class="{{ block.floatPosition }}"&gt;
      &lt;p&gt;{{ block.quote }}&lt;/p&gt;
      &lt;/blockquote&gt;
  
      {% elseif block.type == "image" %}
  
      {% set smallImage
          = {
          mode: 'fit',
          width: 600,
          height: 200,
          quality: {{ block.quality.value }},
          position: 'top-center'
          }
      %}
  
      {% for asset in block.image %}
      &lt;img src="{{ asset.getUrl(smallImage) }}"
      width="{{ asset.getWidth(smallImage) }}"
      height="{{ asset.getHeight(smallImage) }}"&gt;
      {% endfor %}
      {% endif %}
  
  {% endfor %}
  </code></pre>
  
  <p>The <strong>quality</strong> in <em>{{ block.quality.value }}</em> is the name <strong>(handle)</strong> of a field I have storing a number from <strong>1-100</strong> in my Matrix Block. I am using <a href="https://github.com/MaxLazar/mx-rangeslider-craftcms" rel="nofollow noreferrer">Max Lazars range field</a> to store the number.</p>
  
  <p>Upon trying this say by Live Preview the page never refreshes. If I change the <strong>{{ block.quality.value }}</strong> to a number then it all works again as expected.</p>
  
  <p>Would love to get this working so any help would be greatly appreciated to let me know where I'm going wrong.</p>
  
  <p>Thanks,</p>
  
  <p>Mark</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-05-13T22:50:48.733Z
Comments.Text: Aha!!! Got it working at last!!
  
  As I was using Live Preview, even though I was set to Dev Mode for any errors, they weren't showing in the Live Preview pane *(maybe that should be a feature request?)*.
  
  As soon as I tested it out on the live page I saw an error and it told me to place parentheses around an expression so I did this instead quality: (block.quality.value) and all is good with the world now!! :-)
Comments.UserDisplayName: Mark Bowen
Tags: <assets><matrix><image><range>
Title: Inline image transform using Matrix field for image quality?
ThreadText: # Inline image transform using Matrix field for image quality?
  
  (Asked by: username_0 on 2015-05-13)
  
  Hope I'm not posting incorrectly here but don't have enough reputation yet *(really don't understand that system at all)* to be able to comment on another post here on the exchange.
  
  Original Post - [inline image transforms](https://craftcms.stackexchange.com/questions/6783/inline-image-transforms)
  
  I'd like to get this to work but not having any luck at all. This is my code in my template so far.
  
  ```
  {% for block in entry.matrixBlocks %}
  
      {% if block.type == "text" %}
  
      <p>{{ block.text }}</p>
  
      {% elseif block.type == "quote" %}
  
      <blockquote class="{{ block.floatPosition }}">
      <p>{{ block.quote }}</p>
      </blockquote>
  
      {% elseif block.type == "image" %}
  
      {% set smallImage
          = {
          mode: 'fit',
          width: 600,
          height: 200,
          quality: {{ block.quality.value }},
          position: 'top-center'
          }
      %}
  
      {% for asset in block.image %}
      <img src="{{ asset.getUrl(smallImage) }}"
      width="{{ asset.getWidth(smallImage) }}"
      height="{{ asset.getHeight(smallImage) }}">
      {% endfor %}
      {% endif %}
  
  {% endfor %}
  
  ```
  
  The **quality** in *{{ block.quality.value }}* is the name **(handle)** of a field I have storing a number from **1-100** in my Matrix Block. I am using [Max Lazars range field](https://github.com/MaxLazar/mx-rangeslider-craftcms) to store the number.
  
  Upon trying this say by Live Preview the page never refreshes. If I change the **{{ block.quality.value }}** to a number then it all works again as expected.
  
  Would love to get this working so any help would be greatly appreciated to let me know where I'm going wrong.
  
  Thanks,
  
  Mark
  
  **Tags:** assets, matrix, image, range
  
  > **Comments:**
  > **username_0**: Aha!!! Got it working at last!!  As I was using Live Preview, even though I was set to Dev Mode for any errors, they weren't showing in the Live Preview pane *(maybe that should be a feature request?)*.  As soon as I tested it out on the live page I saw an error and it told me to place parentheses around an expression so I did this instead quality: (block.quality.value) and all is good with the world now!! :-)  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2015-05-13. Score: 1
  
  Aha!!! Got it working at last!!
  
  As I was using Live Preview, even though I was set to Dev Mode for any errors, they weren't showing in the Live Preview pane *(maybe that should be a feature request?)*.
  
  As soon as I tested it out on the live page I saw an error and it told me to place parentheses around an expression so I did this instead :
  
  **quality: (block.quality.value)** and all is good with the world now!! :-)
  
  
  ---
  
  