nifel87
nifel87

Reputation: 17

Is it possible to apply the image tag to the result of another image tag?

I have a little question about the image tag of wagtail.

Is it possible to apply the image tag twice time on the same image in a concatenated manner?

For example:

{% image photo width-1500 as photo_scaled %}
{% image photo_scaled fill-400x300 as image %}

Thanks in advance

Upvotes: 0

Views: 44

Answers (1)

LB Ben Johnston
LB Ben Johnston

Reputation: 5176

When you use the template tag image (eg. {% image photo width-1500 as photo_scaled %}), you are generating an image rendition, not a new image. So you cannot then generate a new rendition from a rendition.

A “Rendition” contains the information specific to the way you’ve requested to format the image using the resize-rule, i.e. dimensions and source URL. Image Tag Docs

However, in your question above, fill-400x300 will produce the exact same rendition size/compression - irrelevant to the input image.

Upvotes: 1

Related Questions