Oct 10, 2018
0
Level 5
Crop an image / set new focus
Hello everybody,
I am using Uikit's upload component ( https://getuikit.com/docs/upload ) to upload an image. Now I am using spatie's media library ( https://github.com/spatie/laravel-medialibrary ) to save those images in different conversions.
/**
* @param \Spatie\MediaLibrary\Models\Media|null $media
*
* @throws \Spatie\Image\Exceptions\InvalidManipulation
*/
public function registerMediaConversions(Media $media = null)
{
$this->addMediaConversion('preview')
->fit(Manipulations::FIT_CROP, 400, 320)->withResponsiveImages();
$this->addMediaConversion('thumb')
->fit(Manipulations::FIT_CROP, 120, 120);
}
This works fine - but now I'd like to get the ability to crop the image - the image manipulation does this already, but the user has no possibility to set an own focus or even zoom the image etc.
I'd like to extend my existing system to let the user choose the focus (maybe this is a possibility: https://docs.spatie.be/image/v1/image-manipulations/resizing-images#focal-crop )
I am happy for every idea :-)
Please or to participate in this conversation.