I put this in a chrome extension today. I noticed the missing property on the preview so I wrote a script to estimate it. There's probably a more sensible way to get that value, but considering this hasn't been fixed in four months this works well enough.
It's a bit of a bandaid workaround, but it's good enough for me
function FixImgSearchPreview() {
/**
* Estimates the height of the grid-rows used for the results
*/
function GetRowHeight() {
// Get search results
let results = document.querySelectorAll('._0_image_item');
// limit to a sensible amount
results = Array.from(results).slice(0, 50);
// calculate the average grid-row height
let sum = 0;
let count = 0;
for (let img of results) {
let px = img.clientHeight;
// Slice(5) to cut the 'span ' out of 'span 69'
let rows = Number(img.style.gridRow.slice(5));
sum += px / rows;
count += 1;
}
return sum / count;
}
// Get the preview item
let img = document.getElementsByClassName('item_img_preview')[0];
let span = img.clientHeight / GetRowHeight();
// css doesn't consistently support decimals
// prefer a bit too much space over too little (ceil)
img.style.gridRow = `span ${Math.ceil(span)}`;
}
addEventListener("load", FixImgSearchPreview);
FixImgSearchPreview();
addEventListener("resize", FixImgSearchPreview);
note: I'm just going to run this in a setInterval, because I do not care about the power bill
Going from this:

To this:

As for the original image: (yay for me never deleting anything I do)
