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

Start the cropper with cropdata #57

Open
Matthijz98 opened this issue Jul 3, 2024 · 1 comment
Open

Start the cropper with cropdata #57

Matthijz98 opened this issue Jul 3, 2024 · 1 comment

Comments

@Matthijz98
Copy link

I want to mount the cropper with the crop settings that the users saved before.
The crop results are saved and returned by my api.

But the crop property only accepts x and y not height and width.

Expected behavior
The crop property can accept a value like this:

{"width": 2617, "height": 2617, "x": 848, "y": 568}

The cropper uses these values as the start values

@ValentinH
Copy link
Owner

I think that what you are looking for is the same as the initialCroppedAreaPercentages/initialCroppedAreaPixels of react-easy-crop.
If you are interested to contribute this feature, feel free to check the React implementation and port it to the Svelte one. I'd be happy to review the PR 🙂

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