<p>Try it without the quotes:</p>

<pre><code>{% set transform = {
       mode: block.imageMode,
       width: block.imageWidth,
       position: block.imageFocus
   }
%}
</code></pre>

CC BY-SA 3.0
2015-01-24T18:34:32.793Z
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">
Steven Grant
CC BY-SA 3.0
2015-01-24T19:34:47.723Z
would it make a difference that the image is also coming from S3?
Steven Grant
CC BY-SA 3.0
2015-01-24T20:07:16.273Z
Do a `dump(transform)` and see what that outputs.
Brad Bell
CC BY-SA 3.0
2015-01-24T22:17:18.883Z
http://d.pr/n/19IcA
Steven Grant
CC BY-SA 3.0
2015-01-25T00:32:19.753Z
bizarre, started working - peculiar
Steven Grant
CC BY-SA 3.0
2015-01-25T02:05:48.070Z
lol - let's just say I fixed it and call it a day. :)
Brad Bell
CC BY-SA 3.0
2015-01-24T16:55:03.760Z
2015-01-24T16:55:03.760Z
Brad Bell
<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>

<image-transforms>
inline image transforms
# 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
} %}


  
    
    {% if image.title %}{{ image.title }}{% endif %}
  



{% 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. :)  

---

