F
Filament12mo ago
Saturn

Grid list View - Image Fit Issue

I am working on an grid view where i have both square and landscape image. When i make them display in grid. The image size is too small, if i increase the size it gets cropped. im using Spatie Media Library. so that i can get the image and show it in the list. Is there any other library for that...
No description
No description
2 Replies
dissto
dissto12mo ago
How is your registerMediaConversions function looking for that particular model? You can customise the manipulations upon uploading the media though. Take a look at https://spatie.be/docs/image/v1/image-manipulations/resizing-images#content-fit For example
public function registerMediaConversions(Media $media = null): void
{
$this->addMediaConversion('tiny')
->fit(Manipulations::FIT_FILL_MAX, 50, 50) // <--
->background('ffffff')
->nonQueued();
}
public function registerMediaConversions(Media $media = null): void
{
$this->addMediaConversion('tiny')
->fit(Manipulations::FIT_FILL_MAX, 50, 50) // <--
->background('ffffff')
->nonQueued();
}
Edit: Keep in mind that if you now apply this change it won't work immediatly. You either need to reupload the images or regenerate the images
ingmontoya
ingmontoya11mo ago
Hi, how did you do to acomplish this grid view?
Want results from more Discord servers?
Add your server