Copied to clipboard

Flag this post as spam?

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


  • Saied 349 posts 674 karma points
    Oct 09, 2015 @ 11:24
    Saied
    0

    Does GetCropUrl resize the image and change width/height before it is sent to the browser?

    So I know if you have an image that is 1MB and it's original size is 1280X760 and in the html, you do something like:

    <img src="image-url" width="400" height="400"/>
    

    It will change the dimensions of the image, but it doesn't change the file size, so the browser still downloads the original image. Is this the case with the image processor when I do something like:

     image.GetCropUrl(400,400)
    

    Does it resize the file size and/or change the width and height before sending it to the client? Also, I noticed if I have resize the image to something like 50,50, it looks blurry, is there a way to avoid this with ImageCropper?

    Also, I am using GetCropUrl on images that are picked from the media picker. DoesGetCropUrl still have the same effect on my images even though I am not using theImageCropper data type?

  • Claushingebjerg 939 posts 2574 karma points
    Oct 09, 2015 @ 13:00
    Claushingebjerg
    0

    Yes it makes a new file, so it resizes the file. I guess you could have checked that with developer tools ;)

    If you use image.GetCropUrl(50,50) and render that with <img src="image-url" width="400" height="400"/> it will look blurry, but if you render at normal size, it shouldnt.

    If you want better responsive images, take a look at the Slimsy Package https://our.umbraco.org/projects/website-utilities/slimsy/

  • Saied 349 posts 674 karma points
    Oct 09, 2015 @ 13:29
    Saied
    0

    Yes, I actually did look at developer tools, but just wanted to confirm it. Do you know how I can keep the original center of the image when cropping? Is there a certain mode?

  • Jeavon Leopold 3074 posts 13631 karma points MVP 11x admin c-trib
    Oct 14, 2015 @ 15:31
    Jeavon Leopold
    0

    Using image.GetCropUrl(400,400) will use the focal point (blue dot) for the centre of the crop, do you want to override this and make it always centre?

  • David Brendel 792 posts 2970 karma points MVP 3x c-trib
    Oct 09, 2015 @ 14:41
    David Brendel
    0

    I'm not sure at the moment but i think there are options for the method call to provide some options like centering and so on.

    But can't say for sure out if the box

Please Sign in or register to post replies

Write your reply to:

Draft