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

[Question] How to force cropping before accepting image? #714

Open
styper opened this issue Nov 16, 2024 · 2 comments
Open

[Question] How to force cropping before accepting image? #714

styper opened this issue Nov 16, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@styper
Copy link

styper commented Nov 16, 2024

maryUI version

1.41

daisyUI version

0

Livewire version

3.5

What browsers are affected?

Chrome

What happened?

I'm using the single file upload with preview and cropping, is there a way to only accept the image after it has been cropped?

Scenario is: I'm building a blog like page and the user has the option to upload a cover image.
In the cropper config I'm using 'aspectRatio' => 16/9 since that's the aspect ratio of the cover div.
Problem is, when I select an image it's already displayed in the preview, if I click "cancel" on the crop modal then the image persists in the preview without cropping.

@styper styper added the bug Something isn't working label Nov 16, 2024
@robsontenorio robsontenorio added enhancement New feature or request and removed bug Something isn't working labels Nov 17, 2024
@robsontenorio
Copy link
Owner

Actually it would be a new feature force-crop, and to be honest there are multiples conflicting scenarios to deal with.

@styper
Copy link
Author

styper commented Nov 17, 2024

Understood. I thought maybe there was already a native way since I just started using Mary (great job btw). I may just add an event listener when the modal closes that trashes the image. Thank you for the response!

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

No branches or pull requests

2 participants