Nuhel / FilamentCroppie

MIT License
18 stars 5 forks source link

Adding original size and boundary #2

Closed bnzo closed 1 year ago

bnzo commented 1 year ago

Additional croppie settings.

By default, the size of the resulting image will correspond to imageResizeTargetWidth and imageResizeTargetHeight. Using keepOriginalSize, the size of the resulting image will be at the original scale of the image.

Croppie::make('avatar')->avatar()
    ->enableOpen()->enableDownload()
    ->imageResizeTargetWidth('300')
    ->imageResizeTargetHeight('300')
    ->keepOriginalSize()
    ->modalSize('xl'),

By default, there is no outer container of the cropper. Using withBoundary, we can specify the outer container of the cropper. The specified value is in pixel and will be added to the width and the height of the cropper.

Croppie::make('avatar')->avatar()
    ->enableOpen()->enableDownload()
    ->imageResizeTargetWidth('300')
    ->imageResizeTargetHeight('300')
    ->withBoundary('30')
    ->modalSize('xl'),