Skip to content

Croppable undermining dimension rules #107

@JeroenHauser

Description

@JeroenHauser

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions