AI OnAI Off
Hi Prianka. If you want the image to maintain its aspect ratio, then just set width.
https://docs.sixlabors.com/articles/imagesharp.web/processingcommands.html#resize
Note that "crop" is not used for ImageSharp (but it was for ImageProcessor used in Episerver 11).
Maybe you want to use this:
https://hacksbyme.net/2022/08/16/optimize-images-on-your-optimizely-cms-site/
Hi, We are on Episerver version 12.26.0 and using Baaijte.Optimizely.ImageSharp.Web v2.2.2 package for resizing images on the website. But for wider images, having dimensions eg. 1920 x 430px or 1053 x 440px, the images get cropped when resizing to 880 x550 px. The same code works fine for other rectagular or square images.
If I pass 1280 width when resizing these images and resize method crop, then they render as expected.
We have common code for all languages, how can we ensure that these images don't actually get cut? Can we pass width and height parameter relative to every image?