Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Carlos Mosqueda 240 posts 431 karma points
    Mar 23, 2021 @ 18:54
    Carlos Mosqueda
    0

    Slimsy 2.0 - Set max height ? Keep width fluid

    Is it possible to set a max height with Slimsy 2.0 not using the CropUrl attribute. I have editors who tend to use vertical and horizontal images. Of course if I want a 1920 ratio that is easy for horizontal images but vertical slim images, I need to set a max height for images, then on my container I will make the background a nice black color. But this max height would also need to follow the width sizing as in a CSS width:auto. I need to use Slimsy for the nice compression. On desktop max-height works as the 1080 height but on mobile I need it to still follow the width:auto to shrink with the screen.
    We use this in most cases for horizontal images but for vertical tall thinner uploaded images is crops part of the image out.

    <img src="@Url.GetCropUrl(featureImage, 1920, 1080, quality:60, furtherOptions:"&format=auto")" data-srcset="@Url.GetSrcSetUrls(featureImage, 1920, 1080)" data-src="@Url.GetCropUrl(featureImage, 1920, 1080)" sizes="auto" class="lazyload" />
    

    Any pointers?

    Thank in advance.

Please Sign in or register to post replies

Write your reply to:

Draft