I am using a Page Content Rendering with a custom variant to output an Image property. How could I control the dimensions of the raw image output.
2 Answers
There is no variant definition for an Image field (like there is for a Date field). This is definitely something that is missing in the current version of SXA - I do expect that it is on the roadmap though.
So with simple variants, I'm afraid you cannot scale the image (you could use css to control dimensions but that is not what you want to do).
You might be able to do this using NVelocity, but that will not be as user-friendly as a 'normal' variant definition.
In SXA 1.6,
Try using width and height in the Data Attributes field on the VariantField that is being used to render the image.
This seems to add the width and height attributes to the rendered image (including the url) and subsequently is scaled when the image handler is called.