Compare commits

..

1 Commits

Author SHA1 Message Date
Mathias Bynens
cd4e9fd107 Update index.js 2020-12-10 15:58:55 +01:00
2 changed files with 2 additions and 11 deletions

View File

@@ -19,11 +19,11 @@ function clamp(v, min, max) {
return v;
}
const suffix = ['B', 'KB', 'MB'];
const suffix = ['B', 'KiB', 'MiB'];
function prettyPrintSize(size) {
const base = Math.floor(Math.log2(size) / 10);
const index = clamp(base, 0, 2);
return (size / 2 ** (10 * index)).toFixed(2) + suffix[index];
return (size / 2 ** (10 * index)).toFixed(2) + ' ' + suffix[index];
}
async function decodeFile(file) {

View File

@@ -8,15 +8,6 @@
"value": "no-cache"
}
]
},
{
"source": "**/*.avif",
"headers": [
{
"key": "Content-Type",
"value": "image/avif"
}
]
}
],
"redirects": [{ "source": "/editor", "destination": "/" }]