Small improvements

This commit is contained in:
Stefan Hardegger
2025-08-15 07:58:36 +02:00
parent 460ec358ca
commit 6b83783381
3 changed files with 31 additions and 2 deletions

View File

@@ -78,6 +78,10 @@ export function extractResponsiveImage(
return { url, width };
});
if (sources.length === 0) {
return img.attr('src') || '';
}
const largest = sources.reduce((prev: any, current: any) =>
prev.width > current.width ? prev : current
);