From 31df058f8135f8191c92583f7f06557c3f1ec4e1 Mon Sep 17 00:00:00 2001 From: Alex Ling Date: Sat, 18 Jun 2022 11:25:20 +0000 Subject: [PATCH] Comment about infinity average ratio --- public/js/reader.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/public/js/reader.js b/public/js/reader.js index 11b3b49..fa66b77 100644 --- a/public/js/reader.js +++ b/public/js/reader.js @@ -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;