Hi, I am using Spatie media library.
I wanted to know is it possible to resize main image itself while it to media.
I have added below method to my model for 2nd resized image:
public function registerMediaConversions(Media $media = null): void
{
$this->addMediaConversion('tour-images-medium')
->width(360)
->height(240);
}
Above is working great as expected. So in the end I have 2 images, 1st is main image which is uploaded & 2nd is converted image through above method.
But I wanted to resize main image in 500x500 dimesion, so that if user uploaded 1024x800 image, in the end I should have 1. 500x500 & 2. 360x240 px images and not 1024x800.
I could write anothe addMediaConversion() method for 500x500. But it will result in total 3 images which I don't want.