I'm trying to call an image via an image transform from a matrix field.
So when I do this:
{% if block.type == "standardImage" %}
{% set image = block.imageFile.first() %}
{% if image %}
<img src="{{ image.url('generalImageTransform') }}" width="{{ image.getWidth('generalImageTransform') }}"
height="{{ image.getHeight('generalImageTransform') }}" alt="{{ image.title }}">
{% endif %}
{% endif %}
I get this:
<img src="http://.../cpresources/transforms/1?x=DrK2WYEvg" width="600" height="601" alt="district">
So you can see the width, height and title are all being called successfully, but the image is broken on the web page.
And when I skip the transform and just use {{ image.url() }}
the image is called successfully with
<img src="/images/general/district.png" width="600" height="601" alt="district">
Finally when I add this to the config file
'generateTransformsBeforePageLoad' => true,
I get a PHP error
Image “district.png” cannot be found.
I suspect then that the transformed image is unable to be created, but I don't know how to progress this idea, or if I am on the right track at all.