Fix value of width

This commit is contained in:
yashpalgoyal1304 2022-11-27 01:56:53 +05:30 committed by GitHub
parent 44bc6bf069
commit 225f69b75b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

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