Copied to clipboard

Flag this post as spam?

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


  • John ben 78 posts 293 karma points
    Mar 22, 2017 @ 11:30
    John ben
    0

    Problem with cropimage

    Hi all, I m having a problem, i'm cropping my image in my code here is the code: src.GetCropUrl(105, 130)

    the problem is when i want to see the picture i see some blackspace in my image like this one enter image description here

    i don't know if i badly used my cropper or is it a problem with umbraco?

  • Michael Latouche 504 posts 819 karma points MVP 4x c-trib
    Mar 22, 2017 @ 11:48
    Michael Latouche
    0

    Hi Youness,

    Could it be that your original image has a width smaller than 105? Because in that case the crop would probably make it wider and fill the gaps with black...

    Cheers,

    Michael.

  • John ben 78 posts 293 karma points
    Mar 22, 2017 @ 11:56
    John ben
    0

    Hi Michael,

    No actually my image dimensions are 150 * 200 im trying to get 105 * 130,i even tried 50*50 still the same probleme.

  • Michael Latouche 504 posts 819 karma points MVP 4x c-trib
    Mar 22, 2017 @ 12:01
    Michael Latouche
    100

    Hi Youness,

    Could it be a ratio issue then? because your ratio 150 => 105 is 70% and your ratio 200 => 130 is 65 %

    I don't know cropimage that well, but could it be that somehow it keeps the ratio by default, and that there is, some extra parameter to pass to indicate to ignore ratio? Or maybe you need to specify the upper-left point to start cropping from?

    Cheers,

    Michael.

  • John ben 78 posts 293 karma points
    Mar 23, 2017 @ 17:21
    John ben
    0

    Hi michael i just want to know why is umbracocropper using ratio ? cropping image does'nt mean cutting the image so it can get the size we want no?

  • Michael Latouche 504 posts 819 karma points MVP 4x c-trib
    Mar 23, 2017 @ 20:47
    Michael Latouche
    0

    Hi Youness,

    I have no idea why it does, I would expect the same as you, that it would crop to whatever size we want... but then you would need to specify from which coordinates it should start the cropping.

    That's a question for the person who built the package I guess ;-)

    Cheers,

    Michael.

Please Sign in or register to post replies

Write your reply to:

Draft