I’m implementing lazyloading with responsive images in a css-grid (lostgrid) and i would like to have the image-wrapper shown at the width and height of the image and with a background-color even before the image gets loaded.
My first idea was to use ->ratio() to get the image-ratio and then use that information to set a height for my image-wrapper which works so far quite well.
My only problem is that some images, seem to have slightly different ratio. For exemple 1.4723 and 1.501. It isn’t dramatic but im looking of a better way to handle that problem.
Should i use ->crop() to make sure images are cropped at a precise ratio ?
thanks fo any suggestions.
. The