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

Cropping does not work if the user does not change the default bounding box (React component) #298

Closed
sturatcliffe opened this issue Feb 1, 2023 · 6 comments
Labels
bug Something isn't working Released The issue is fixed/considered and released

Comments

@sturatcliffe
Copy link

Hey,

I have an instance of the React component configured so that the default (and only) tool available is the crop tool, so when the component first loads it shows the default crop boundary based on the aspect ratio provided.

However, if the user does not interact with the default boundary, the crop does not work and the output is the full image. If it matters, I'm not using the save modal, I'm using the getCurrentImgDataFnRef prop and extracting the base64 image data like so:

const {
   imageData: { imageBase64 },
} = getCurrentImgDataFnRef.current()

Thanks

@AhmeeedMostafa
Copy link
Collaborator

Could u please provide a codesandbox that contains ur code exactly to check it and have it reproduced?

@AhmeeedMostafa AhmeeedMostafa added the TBD To Be Defined means that issue needs to be checked and re-labeled after checking label Feb 2, 2023
@sturatcliffe
Copy link
Author

Hi @AhmeeedMostafa - sure, codesandbox here:

https://codesandbox.io/s/empty-violet-3z81j3?file=/src/App.js

If you upload a file, and hit the save button below the editor, the output is the full image rather than the cropped version. Then if you move the crop handles a little and hit the save button again, it works and actually crops the image.

Cheers.

@AhmeeedMostafa
Copy link
Collaborator

Okay we will check it once we have time and if it's found we will consider its fix and notify you

@AhmeeedMostafa AhmeeedMostafa added TBC (To Be Checked) means the issue needs to get investigated by the product dev./QA and removed TBD To Be Defined means that issue needs to be checked and re-labeled after checking labels Feb 2, 2023
@AhmeeedMostafa AhmeeedMostafa added bug Something isn't working and removed TBC (To Be Checked) means the issue needs to get investigated by the product dev./QA labels Feb 9, 2023
@AhmeeedMostafa AhmeeedMostafa added the Waiting release The issue's code is added in the dev. branch but not yet released label Apr 10, 2023
@AhmeeedMostafa AhmeeedMostafa added Released The issue is fixed/considered and released and removed Waiting release The issue's code is added in the dev. branch but not yet released labels Jun 9, 2023
@AhmeeedMostafa
Copy link
Collaborator

it's fixed in v4.5.0 now, thanks for reporting.

@mkozen
Copy link

mkozen commented Nov 16, 2023

I have the same bug in v4.5.1

@D0m1N1k999
Copy link

For me it works on the first upload, however if I change the image, cropping has no effect, unless the user interacts. (v4.8.1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Released The issue is fixed/considered and released
Projects
None yet
Development

No branches or pull requests

4 participants