Copied to clipboard

Flag this post as spam?

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


  • Jake 4 posts 94 karma points
    May 03, 2017 @ 11:22
    Jake
    0

    How do i remove umbraco crop feaure from my img src

    Hi,

    Apologies in advance i'm a complete novice to umbraco, long story short on one of my sites an image is being cropped, it spits out the following in the dom

    /media/1414/kelly_500x500.jpg?width=470&height=355&mode=crop&quality=75

    When i remove everything after the "?" the problem is solved.

    I have located where the code is printing out the image but can't see anything to do with crop any suggestions ?

    @Umbraco.Image(image, 470, 355, cssClass: "img-responsive")

  • Marc Goodson 2141 posts 14324 karma points MVP 8x c-trib
    May 04, 2017 @ 13:23
    Marc Goodson
    0

    Hi Jake

    It looks like someone has implemented a custom helper method in your site to write out your html image tag based on various settings...

    ... this helper

    @Umbraco.Image(image, 470, 355, cssClass: "img-responsive")
    

    is saying write out your <img tag and add the css clsas "img-responsive" and resize the image to be 470 wide by 355

    in their implementation of this helper (check the app_code folder, or search any visual studio solution for:

    Image(this UmbracoHelper,

    and that should find the actual implementation...

    the implementation is probably using GetCropUrl

    https://our.umbraco.org/documentation/getting-started/backoffice/property-editors/built-in-property-editors/image-cropper

    which is why your images are being cropped to the dimensions and not resized (if that is your preference)

    Resize modes for ImageProcessor (that Umbraco uses for images) is here:

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

    you want to update your helper so you can write something like

    @Umbraco.Image(image, 470, 355, cssClass: "img-responsive", resizeMode: "max")

    and have the helper construct the url:

    /media/12344/mylovelyimage.jpg?width=470&height=355&mode=max

    if that helps...

    regards

    Marc

Please Sign in or register to post replies

Write your reply to:

Draft