Image scales are cropped

For some reasons the image scales are cropped instead of resized. What could be the reason for this behavior. I have no errors in the log.
Using Plone 5.2 with plone.scale 4.1

That depends on how the tag is generated in your template. Typically there is a snipped like

<img tal:define="scales context/@@images"
         tal:replace="structure python: scales.scale('image', scale='preview', mode='scale')" />

the mode parameter defines if the image is cropped or scaled down/up. "scale" is scaled to its boundaries, "contain" and "cover" are cropped. See https://github.com/plone/plone.scale/blob/4.1.0/plone/scale/scale.py#L206 for the modes.

Previously the mode parameter was called direction so if you see this in a template, you can safely replace it with mode and use the new mode values.

2 Likes

Thanks!!!