Copied to clipboard

Flag this post as spam?

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


  • Anne Uth 23 posts 43 karma points
    Mar 26, 2015 @ 10:51
    Anne Uth
    0

    Imagesize bigger with imagecropper than without

    Hi,

    I have an umbraco 7 website where i use the imagecropper to give image in different sizes depending on which device you use.

    On desktop the crop is 1440*710

    I have uploaded an image that is optimised for web for the imagesize is 160KB and 1440*710. 

    But if i use the cropper to get the image the imagesize is twice as big. 329KB

    Does anybody know why this is?

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Mar 26, 2015 @ 11:02
    Jeavon Leopold
    0

    Hi Anne,

    As you are cropping the image it is being recreated. Do you have a quality variable on your url (I think it got slightly cut off)?

    Jeavon

  • Anne Uth 23 posts 43 karma points
    Mar 26, 2015 @ 11:06
    Anne Uth
    0

    No i don't have that. How do i do that?

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Mar 26, 2015 @ 11:07
    Jeavon Leopold
    0

    Could you post your code with the GetCropUrl method?

  • Anne Uth 23 posts 43 karma points
    Mar 26, 2015 @ 11:09
    Anne Uth
    0

    Yes, I do like this:

    var media = helper.TypedMedia(Id);

    media .GetCropUrl("Desktop");

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Mar 26, 2015 @ 11:16
    Jeavon Leopold
    0

    Great, so you should be able to do this:

    media.GetCropUrl(cropAlias: "Desktop", furtherOptions: "&quality=80");
    
  • Anne Uth 23 posts 43 karma points
    Mar 26, 2015 @ 11:20
    Anne Uth
    0

    Thanks. Now it is 263KB so it helped. Do you know where i kan find a description of what i can put in "furtherOptions"?

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Mar 26, 2015 @ 11:23
    Jeavon Leopold
    0

    Yes, you can use any method listed on the ImageProcessor.Web documentation here

  • Anne Uth 23 posts 43 karma points
    Mar 26, 2015 @ 14:58
    Anne Uth
    0

    When i use quality as a parameter the width and height disappears from the url

     

    before

    /media/1594/forsideannonce-ny-pro.jpg?anchor=center&mode=crop&width=1440&height=710&rnd=130711490020000000

    After

    media/1594/forsideannonce-ny-pro.jpg?anchor=center&mode=crop&quality=60&rnd=130718462820000000

    Now the image is not cropped in the correct size. How do i get the width and height back?

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Mar 26, 2015 @ 16:41
    Jeavon Leopold
    0

    Ah try this:

    media.GetCropUrl(cropAlias: "Desktop", useCropDimensions:true, furtherOptions: "&quality=80");
    
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies