Not all thumbnail sizes croppable (jQuery v3)
Hi there,
first of all, thanks for this cool plugin, great effort!
We've been having trouble with the plugin at work, though, since we've installed it (v0.4.0 - v0.4.3). The issue is very similar to #119, but it only happens to some select image sizes: The WP installation in question ships with 12 different thumbnail sizes, but for some (seemingly random) images, cropping is not possible for some sizes. Sometimes it's just two sizes that aren't croppable, sometimes its more – also at random.
I've been trying to fix this myself, but sadly that has been unsuccessful, so far – the only thing I found while debugging is that $img.width( Math.round( $img.innerWidth() ) ); which was implemented in #121 does not work reliably – but that's the same for croppable as well as for non-droppable thumbnail sizes.
This must be related to the jQuery upgrade to v3: When I downgrade my local WP instance to v5.5.9 the issue is gone! Upgrading to v5.9.3 does not help (we're running WP with v5.7.6 in production).
Hopefully you have an idea what might be going wrong, here? I can provide more info, if needed. Thanks in advance 🤙
are you people aware that the underlying package https://github.com/odyniec/imgareaselect has not been updated in almost 10 years, has 53 unresolved issues and was last tested with jQuery v1.9?
I have the same problem on my side! Do you have an update on that?
Thanks for the report, sounds like maybe a race condition if it's at random. Do you mean if you reload and try to crop the same image at the same size it works sometimes but not others?
It would really help to have some consistent steps to reproduce the error. imgareaselect still ships with WP but agree, we could look for something more up to date now.
Hi @roborourke, I don't work on that project/at the company anymore, In fact I don't work with php anymore.
The way I remember it: I upload an image, and afterwards I open it with smart media in order to customise certain thumbnails. For no apparent reason cropping would not be possible for random thumbnail sizes – this means those thumbnails are never croppable, not after a page refresh, not in any browser. If I deleted the image and re-uploaded it, possibly all sizes would be croppable, but possibly this time some other random thumbnails would not be croppable (I'm a bit fuzzy on this latter part, though).
no worries @dkress59, my fault for not seeing this sooner. Depending on the image I can imagine this happening but it'd be consistent, e.g. if an image was too small to be cropped for certain registered theme sizes etc... etc..
@Brickphilla is this still a problem for you and do you have a consistent way to reproduce? e.g. specific theme or thumbnail sizes used, specific images you were uploading, WP version, smart-media version etc...