Fixed typo

It was late when I typed this 😆
This commit is contained in:
litetex 2022-02-16 20:31:15 +01:00 committed by GitHub
parent c08a4e851b
commit 7225199deb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -8,8 +8,8 @@ module.exports = async ({github, context}) => {
const IMG_MAX_HEIGHT_PX = 600; const IMG_MAX_HEIGHT_PX = 600;
// maximum width of GitHub issues/comments // maximum width of GitHub issues/comments
const IMG_MAX_WIDTH_PX = 800; const IMG_MAX_WIDTH_PX = 800;
// all images that have a lower aspect ration (-> have a smaller width) than this will be minimized // all images that have a lower aspect ratio (-> have a smaller width) than this will be minimized
const MIN_ASPECT_RATION = IMG_MAX_WIDTH_PX / IMG_MAX_HEIGHT_PX const MIN_ASPECT_RATIO = IMG_MAX_WIDTH_PX / IMG_MAX_HEIGHT_PX
// Get the body of the image // Get the body of the image
let initialBody = null; let initialBody = null;
@ -76,7 +76,7 @@ module.exports = async ({github, context}) => {
} }
console.log(`Probing resulted in ${probeResult.width}x${probeResult.height}px`); console.log(`Probing resulted in ${probeResult.width}x${probeResult.height}px`);
shouldModify = probeResult.height > IMG_MAX_HEIGHT_PX && (probeResult.width / probeResult.height) < MIN_ASPECT_RATION; shouldModify = probeResult.height > IMG_MAX_HEIGHT_PX && (probeResult.width / probeResult.height) < MIN_ASPECT_RATIO;
} catch(e) { } catch(e) {
console.log('Probing failed:', e); console.log('Probing failed:', e);
// Immediately abort // Immediately abort