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 %}