WordPress.org

Support

Support » Plugins and Hacks » Manual Image Crop » Crop sizes are sometimes incorrect!

Crop sizes are sometimes incorrect!

  • Hi Tomasz,

    I’d like to start by congratulating you on such a great plugin – it’s been extremely valuable to me on my latest project.

    I have found a strange issue though. Sometimes when I go to do a manual crop, the crop area is not the right size/proportions. For instance, one of my crops is 240×160 (hard crop) but the manual crop selection is not correct – it is too wide in relation to height. Please see this screen grab.

    You can see that the ‘Previous image’ (the one that’s automatically created from the crop dimensions) is correct, but the crop selection box and the ‘New image’ are wrong!

    This doesn’t always happen for this crop size – just with certain images. I havent been able to work out the relationship between the ones that get the wrong sized crop selection but maybe it’s to do with the original images dimensions?

    Here’s a screen grab of a correct crop selection

    https://wordpress.org/plugins/manual-image-crop/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Tomasz Sita

    @tomaszsita

    Hi cokeyblokey,

    I will have a look into that. I guess it must be something with the original image dimensions… i will do some tests and hopefully manage to recreate the issue.

    Thanks

    Thanks Tomasz,

    Should be relatively easy to recreate the issue.

    Register a crop size of 240 x 160 (hard crop)

    upload an image with dimensions 354 x 337

    you should then see the problem.

    then upload an image with dimensions 410 x 336 and the crop selection will be correct for that one.

    If I get more time today I’ll try to experiment further – I’ve already discounted the fact that one of the dimensions was an odd number. Changing 337 to 336 made no difference, the problem still occured.

    I have been experiencing the same issue. I found that copying the image, pasting it into a new document and re-saving it as JPG, then re-uploading it to wordpress seems to fix the issue.
    So it’s something to do with the JPG’s compression or aspect ratio?

    Fantastic plugin, by the way 🙂

    It’s because of the min values of $previewWidth, $previewHeight, $minWidth and $minHeight in the ManualImageCropEditorWindow.php.
    It just happens with small source images, as far as i can say. Beaause of the min values the crop stage doesnt work correct if the image is smaller. Could fix this for me with editing the plugin file but should be a better solution. Spend defenitely too much in researching this bug.

    Beside this excellent plugin.
    Cheers.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Crop sizes are sometimes incorrect!’ is closed to new replies.
Skip to toolbar