-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Site Editor: Image cropping tools broken #38557
Comments
I can reproduce the behaviour. Zoom
Aspect ratio
Rotation
|
I think this might be an issue with the cc @talldan. |
I tested manually adding There's more info in the react-easy-crop docs about loading styles. |
@annezazu I could also see it in a different way.
task.mp4 |
Thanks for the video here! I'm wondering what's going on since your image dimensions are showing -1777 for width and -1918 for height 😱 . I tried to replicate but couldn't even if I tried adding duotone and text. Here's a condensed video: image.mov |
This is still a problem with GB 14.0.2 and WP 6.0.2: image.tools.mp4Going to add this to the 6.1 board just in case it can be addressed. |
I've removed the 'Backport to WP Beta/RC' label as that's just for PRs.
I don't know much about it unfortunately, I just refactored some of the code to make fixing a bug easier. IIRC though, pretty much everything was implemented by that easy-cropper library, apart from rotation, which is our own implementation. Rotation seems to be working ok, so it'd suggest the bulk of the issues are to do with react-easy-cropper/iframes.
@ajlende Would you be able to create a PR with this change? A partial fix would be better than nothing. |
@dugyen The target is to get a fix for WordPress 6.1, but there isn't any working code that resolves the issue yet. There's a bit of a risk as well because the feature depends on a third-party library, but hopefully it's something that can be solved. 👍 |
Had a brief look and I think we would either need to fork the library, or see if we can push back a change to the project. Currently the lib makes a number of calls to the global It shouldn't be too hard to sort in theory, by either adding some props to pass in the doc and window references, or to work them out using one of the refs within the component, similar to what happens in the Jetpack maps block to gets its 3rd party library to work in the site editor. I will try and take a look and see if we can get this fixed, but if it involves getting a patch accepted by the library it may not be doable in 6.1 timeframes. |
@ValentinH was very responsive when I made some changes to react-easy-crop earlier, so unless he's especially busy, I think there's a good chance of landing the change. @glendaviesnz it sounds like you have a plan for fixing it already, but I'll be here to help out with testing if you have a branch pushed up that I can take a look at. |
Hey, |
thanks @ajlende and @ValentinH, if my cunning plan works I should have a PR up in the |
Love this cross collaboration. Thanks so much for chiming in and offering to help @ValentinH! |
@ValentinH this approach seems to work for our iframed instance, but not sure if it has any potential issues/drawbacks in other contexts. |
A PR in the 3rd party library is ready for review |
Fixed by ValentinH/react-easy-crop#410 & #44408 |
Description
Cropping in the site editor seems broken across multiple levels compared to in the post editor:
This only seems to happen in the Site Editor. I could replicate this across two different sites with 5.9.
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
My.Movie.18.mp4
Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: