Minimize not-so-long images too

pull/9471/head
yashpalgoyal1304 2022-11-27 03:22:37 +05:30 zatwierdzone przez GitHub
rodzic 7c1d06e023
commit e9ef9451e5
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -88,7 +88,7 @@ module.exports = async ({github, context}) => {
if (shouldModify) {
wasMatchModified = true;
console.log(`Modifying match '${match}'`);
return `<img alt="${g1}" src="${g2}" width=${(IMG_MAX_HEIGHT_PX * probeAspectRatio).toFixed(0)} />`;
return `<img alt="${g1}" src="${g2}" width=${Math.min(600, (IMG_MAX_HEIGHT_PX * probeAspectRatio).toFixed(0))} />`;
}
console.log(`Match '${match}' is ok/will not be modified`);