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

Croppable undermining dimension rules #107

Open
JeroenHauser opened this issue Jul 9, 2023 · 0 comments
Open

Croppable undermining dimension rules #107

JeroenHauser opened this issue Jul 9, 2023 · 0 comments

Comments

@JeroenHauser
Copy link

JeroenHauser commented Jul 9, 2023

Hi! First of all, thanks for creating this package. It's very helpful on a project I'm working on 🙂

Unfortunately, the croppable() option is undermining the Nova dimension rules.

AdvancedImage::make('image_path') ->hideFromIndex() ->rules('image', 'dimensions:min_width=1000') ->croppable() ->resize(1000)

Now, I can upload an image with an original width of 2000px. Then I make the croppable box very, very small. When I save it, the saved image has only a width of 150px. This is understandable: the Nova rules check the dimensions on the uploaded image, not the end result after cropping and resizing. Also the resize() option doesn't make the end result viable, since by default it's instructed not to upsize.

What would be really great, is when the minWidth options of cropperjs would also be set whenever a resize() value is set. Users then cannot make the cropper smaller than the minimum dimensions.

I'm sorry I cannot contribute to the package myself. I only started developing Laravel 9 months ago. Packages and Nova are still a little bit magic to me. I looked at the code, but I also see that it requires changes to the Vue files. My Vue experience level is zero, unfortunately. I'll be patiently waiting for this improvement, hope it ends up on the backlog!

@JeroenHauser JeroenHauser changed the title Droppable undermining dimension rules Croppable undermining dimension rules Jul 9, 2023
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

1 participant