Copied to clipboard

Flag this post as spam?

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


  • Dick Gennissen 5 posts 25 karma points
    Oct 27, 2015 @ 14:41
    Dick Gennissen
    0

    Umbraco ImageCropper bug and always saves the center of the image

    // UPDATE 5 MINUTES LATER : We experience the same problem with an Umbraco 6.1.6 installation //

    We have an Umbraco 4.11.10 installation and are using the ImageCropper to ensure the images on the website are cropped by the correct size and aspect-ratio.

    Now we have noticed the ImageCropper of Umbraco has a problem/bug with crops on larger images.

    We have experienced that : An image has the dimensions (W * H) : 3617px x 1200px.

    One of our croppings has the following settings : width:960px, heigth: 960px, keep aspect : yes, CM.

    With the image cropper loading we see that cropping defaulty loads with the cropping dimension of : 1201 x 1201 Which means the crop will be 1 pixel larger then the original size. (weird, sounds like a rounding problem in JCrop).

    enter image description here

    Now our problem: Dispite sliding the crop from left to right, after saving the cropping is always in the dead-center of the image. Diving inside the code of Umbraco I see the following code within the "GenerateThumbnails" function of the "ImageInfo" class of umbraco.editorControls.imagecropper :

    enter image description here

    With this 1 pixel difference, the if-statement wich checks if the cropping is larger than the original image-size is always True. Which means the Preset.Fit(this); function is called and the center of the image is always taken.

    Our question: How do we fix this? Can we update to a later version where this but is resolved? Or how do I change the rounding of JCrop to ensure the 1200 height is 1200 px and not 1201 px.

    Please help!

  • Dick Gennissen 5 posts 25 karma points
    Aug 19, 2016 @ 16:37
    Dick Gennissen
    0

    Anyone??!

Please Sign in or register to post replies

Write your reply to:

Draft