Open dani-ooo opened 5 years ago
i think derivatives()
has a conditional to avoid this — maybe it could be added to cropZoom()
as well?
https://github.com/getgrav/grav/blob/f1363877d8782fbceb4dd53d38d538f57b7104de/system/src/Grav/Common/Page/Medium/ImageMedium.php#L279-L280
for now, i've come up with a workaround — using the min()
between the image's width
and height
as the cropZoom()
parameters:
{{ image.cropZoom(min(image.width, image.height), min(image.width, image.height)) }}
is there a way to prevent
cropZoom()
from upscaling images? is this the expected behavior?if i have an image that's 1200×800, and i pass it through
cropZoom(2000,900)
, it is upscaled with the new proportion. i want the image to be crop-zoomed to the new aspect ratio, but not bigger than the original dimensions.cropResize()
already behaves this way.