acf-image-aspect-ratio-crop icon indicating copy to clipboard operation
acf-image-aspect-ratio-crop copied to clipboard

Min. width and height disregarded when pixel size chosen as crop type

Open z0mbat opened this issue 4 years ago • 4 comments

I've created a field with crop type "Pixel size" and a width and height of 800x600 pixels. Your plugin automatically fills out the minimum required size to match the entered width and height.

The problem is, that even though the minimum requirements are set, I can still choose a smaller image, which I'm not supposed to. I tested using an image with the dimensions 700x671 pixels . Apparently the minimum requirements are disregarded.

If I set minimum size requirements for the crop type "Aspect ratio", it's working as intended and I'm not allowed to choose a smaller image than what's defined.

Active plugins:

  • ACF Pro 5.8.9
  • Advanced Custom Fields: Image Aspect Ratio Crop 3.2.0
  • WooCommerce 4.0.1
  • Yoast SEO 13.4.1

Other details

  • Wordpress 5.4

z0mbat avatar Apr 14 '20 07:04 z0mbat

Hey, thanks for your bug report.

You are right, minimum dimensions should be respected when using the pixel crop option.

I will try to see if I can reproduce this issue on my end.

joppuyo avatar Apr 16 '20 14:04 joppuyo

Hey, I managed to reproduce the problem and included a fix in the latest version of the plugin.

Could you check if the issue still exists for you?

joppuyo avatar May 20 '20 14:05 joppuyo

Sorry for my late reply.

I just tested it, and I'm still able to choose an image that is too small.

Something I forgot to mention is, that I'm using the image crop field in an ACF Block used in Gutenberg. I don't know if it's a Gutenberg related issue.

z0mbat avatar Jun 15 '20 14:06 z0mbat

Hey, I managed to track down this bug and hopefully fix it for good. Could you install version 4.0.2 or 3.4.1 and test if you can still reproduce the issue?

I will have to create an automated test to prevent this from happening in the future. I have now set up a test matrix with all WP versions from 4.9 to 5.5 and ACF versions from 5.8 to 5.9, but the tests themselves are really basic. Now I just need to create tests to check all features.

joppuyo avatar Aug 17 '20 14:08 joppuyo