Comment about infinity average ratio

This commit is contained in:
Alex Ling 2022-06-18 11:25:20 +00:00
parent fe440d82d4
commit 31df058f81

View File

@ -34,6 +34,8 @@ const readerComponent = () => {
};
});
// Note: for image types not supported by image_size.cr, the width and height will be 0, and so `avgRatio` will be `Infinity`.
// TODO: support more image types in image_size.cr
const avgRatio = dimensions.reduce((acc, cur) => {
return acc + cur.height / cur.width
}, 0) / dimensions.length;