Skip to content
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

cropArea not resetting after image rotation #19

Open
Malli1320 opened this issue Dec 19, 2023 · 1 comment
Open

cropArea not resetting after image rotation #19

Malli1320 opened this issue Dec 19, 2023 · 1 comment

Comments

@Malli1320
Copy link

@ailon

  1. When we rotate an image , the crop Area is not adjusting to the rotated image size , therefore it allowing to crop beyond the image as below
    cropArea-rotation

  2. Once the image is rotated, it takes the dimensions of the previous image only, it's not taking full width, Therefore it becomes difficult to resize the crop rectangle on rotated image in mobile screen as below
    mobile-image-no-rotate
    mobile-image-rotate

Here's the link to reproduce the above mentioned issues
https://codesandbox.io/p/sandbox/cropro-all-defaults-demo-forked-2lkll7

Can you suggest what needs to be done to to resolve above issues..

@ailon
Copy link
Owner

ailon commented Dec 19, 2023

  1. this is "by design" as the primary purpose is cropping. When you rotate in non-90deg ways the goal is to preserve all the image information and let the user decide whether they want to crop to fill a specific rectangle or leave the empty margins but keep all or most of the info.
  2. I see what you mean but since the internal image is still that tall vertical image and sizing is based on that. A not-very-nice workaround but the only one I can think of is to rotate, do the initial crop, save, and then reopen cropro with the horizontal image to crop further. Can't think of anything better at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants