Copied to clipboard

Flag this post as spam?

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


  • Greg Fyans 112 posts 271 karma points
    May 17, 2016 @ 06:59
    Greg Fyans
    0

    Image Cropper - image scale-to-fit?

    Is it possible to have the image cropper scale an image down to fit the crop dimensions (which would then either pad vertically or horizontally), rather than what it currently does - fits the height of the crop and the rest be damned!

    What I mean is this:

    What I mean is this

    As you can see from the image, this is a particularly problematic issue for logos.

    Is it at all possible to do this, even if I have to edit some Umbraco scripts?

  • Anthony Chudley 50 posts 197 karma points
    May 17, 2016 @ 08:50
    Anthony Chudley
    0

    I know it can be done with the ImageProcessor service.

    I do something like this on one of my sites:

    http://localhost/media/123/imagename.jpg?width=700&height=700&mode=max

    I would guess there is a way to add an override to the render to just change the crop mode. Not sure though.

  • Dan Diplo 1463 posts 5637 karma points MVP 3x c-trib
    May 17, 2016 @ 09:11
    Dan Diplo
    1

    You can apply query string parameters to your image URL that affect how it will be processed by ImageProcessor.

    ImageProcessor.Web allows you to scale images both up and down with an excellent quality to size ratio. A maximum width and height can be set in the configuration to help protect you from DoS attacks.

    Six different types of resizing methods are available:

    Pad (default) BoxPad (Added v4.4.0) Crop Min (Added v4.4.0) Max Stretch

    See the docs at:

    http://imageprocessor.org/imageprocessor-web/imageprocessingmodule/resize/

Please Sign in or register to post replies

Write your reply to:

Draft