are there any packages to allow users to manipulate an image when uploading?
I am currently using the Spatie media library which has a section for manipulations in the plugin docs, but If you want "media specific" manipulations, wouldnt hat imply that the user should have an opportunity to define the manipualtion? otherwise every image uploaded through that input would end up with the manipulation. as defined in the docs
'
#Storing media-specific manipulations
You may pass in manipulations that are run when files are uploaded using the manipulations() method:
use Filament\Forms\Components\SpatieMediaLibraryFileUpload;
SpatieMediaLibraryFileUpload::make('attachments')
->multiple()
->manipulations([
'thumb' => ['orientation' => '90'],
])
'
But how can I give the end user a chance to rotate, and set an image to a square crop where they can adjust the crop location best for the uploaded image?
cropper.js seems to be the tool I need, but I don't know how to go about implementing it with Filament, or laravel in general?
are there any existing plugins that handle this?
Or any guidance on how to implement it within the form builder?
3 Replies
i found https://v2.filamentphp.com/plugins/image-cropper for vs2 of filament which appears to do what I need, but it appears to not be usable with the Spatie functionality?
IS there anything similar to extend spatie or the regular file upload?
I found this too... but it is also out of date.
I dont know enough to update it myself:
https://github.com/josefbehr/filament-spatie-media-library-croppie
GitHub
GitHub - josefbehr/filament-spatie-media-library-croppie: Spatie Me...
Spatie Media Library Upload Field using Croppie. Contribute to josefbehr/filament-spatie-media-library-croppie development by creating an account on GitHub.
can this functionality be implemented in the filament spatie plugin and core image upload functionality itself? I think it would be a welcomed feature for many.