Answers.Body: <p>Try it without the quotes:</p>
  
  <pre><code>{% set transform = {
         mode: block.imageMode,
         width: block.imageWidth,
         position: block.imageFocus
     }
  %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-01-24T18:34:32.793Z
Answers.Text: negative - even tried putting the quotes into the actual dropdown selector value in the CP. The src of the image is <img src="http://craft.dev/resources/transforms/9?x=JnxyQdEtY" width="300" height="105" alt="WebBanner">
Answers.UserDisplayName: Steven Grant
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-01-24T19:34:47.723Z
Answers.Text: would it make a difference that the image is also coming from S3?
Answers.UserDisplayName: Steven Grant
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-01-24T20:07:16.273Z
Answers.Text: Do a `dump(transform)` and see what that outputs.
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-01-24T22:17:18.883Z
Answers.Text: http://d.pr/n/19IcA
Answers.UserDisplayName: Steven Grant
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-01-25T00:32:19.753Z
Answers.Text: bizarre, started working - peculiar
Answers.UserDisplayName: Steven Grant
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-01-25T02:05:48.070Z
Answers.Text: lol - let's just say I fixed it and call it a day. :)
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-01-24T16:55:03.760Z
Answers.LastActivityDate: 2015-01-24T16:55:03.760Z
Answers.UserDisplayName: Brad Bell
Body: <p>Is it possible to set an inline image transform's settings from the output of a Matrix block field?</p>
  
  <p>For example </p>
  
  <pre><code>{% set transform = {
    mode: 'block.imageMode',
    width: block.imageWidth,
    position: 'block.imageFocus'
  } %}
  </code></pre>
  
  <p>Each time I've tried this, the image gives 404. I know the surrounding code works as expected because hard coding the values, the image displays as we'd expect.</p>
  
  <p>This works just fine:</p>
  
  <pre><code>{% set transform = {
    mode: 'crop',
    width: 300,
    quality: 70,
    position: 'center-center'
  } %}
  </code></pre>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Some surrounding code for context</p>
  
  <pre><code>{% for image in block.image %}
  
  {% set transform = {
    mode: block.imageMode,
    width: block.imageWidth,
    quality: 70,
    position: block.focalPoint
  } %}
  
  &lt;div class="figure  image--{{ block.imagePosition }}"&gt;
    &lt;p&gt;
      &lt;img src="{{ image.getUrl(transform) }}" width="{{ image.getWidth(transform) }}" height="{{ image.getHeight(transform) }}" alt="{{ image.title }}"&gt;
      {% if image.title %}&lt;b class="figure__caption"&gt;{{ image.title }}&lt;/b&gt;{% endif %}
    &lt;/p&gt;
  &lt;/div&gt;
  &lt;!-- // .figure --&gt;
  
  {% endfor %}
  </code></pre>
  
Tags: <image-transforms>
Title: inline image transforms
ThreadText: # inline image transforms
  
  (Asked by: username_0 on 2015-01-24)
  
  Is it possible to set an inline image transform's settings from the output of a Matrix block field?
  
  For example
  
  ```
  {% set transform = {
    mode: 'block.imageMode',
    width: block.imageWidth,
    position: 'block.imageFocus'
  } %}
  
  ```
  
  Each time I've tried this, the image gives 404. I know the surrounding code works as expected because hard coding the values, the image displays as we'd expect.
  
  This works just fine:
  
  ```
  {% set transform = {
    mode: 'crop',
    width: 300,
    quality: 70,
    position: 'center-center'
  } %}
  
  ```
  
  **EDIT:**
  
  Some surrounding code for context
  
  ```
  {% for image in block.image %}
  
  {% set transform = {
    mode: block.imageMode,
    width: block.imageWidth,
    quality: 70,
    position: block.focalPoint
  } %}
  
  <div class="figure  image--{{ block.imagePosition }}">
    <p>
      <img src="{{ image.getUrl(transform) }}" width="{{ image.getWidth(transform) }}" height="{{ image.getHeight(transform) }}" alt="{{ image.title }}">
      {% if image.title %}<b class="figure__caption">{{ image.title }}</b>{% endif %}
    </p>
  </div>
  <!-- // .figure -->
  
  {% endfor %}
  
  ```
  
  **Tags:** image-transforms
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-01-24. Score: 2 | Accepted answer
  
  Try it without the quotes:
  
  ```
  {% set transform = {
         mode: block.imageMode,
         width: block.imageWidth,
         position: block.imageFocus
     }
  %}
  
  ```
  
  > **Comments:**
  > **username_0**: negative - even tried putting the quotes into the actual dropdown selector value in the CP. The src of the image is <img src="http://craft.dev/resources/transforms/9?x=JnxyQdEtY" width="300" height="105" alt="WebBanner">  
  > **username_0**: would it make a difference that the image is also coming from S3?  
  > **username_1**: Do a `dump(transform)` and see what that outputs.  
  > **username_0**: http://d.pr/n/19IcA  
  > **username_0**: bizarre, started working - peculiar  
  > **username_1**: lol - let's just say I fixed it and call it a day. :)  
  
  ---
  
  