Compare commits

..

2 Commits

Author SHA1 Message Date
Adam Argyle
dab10d9940 Merge branch 'dev' into avif-header-patch 2020-12-10 07:34:51 -08:00
Adam Argyle
b61f1ffbcf leverage fix from https://github.com/v8/v8.dev/pull/504 2020-12-09 15:56:16 -08:00
2 changed files with 11 additions and 2 deletions

View File

@@ -19,11 +19,11 @@ function clamp(v, min, max) {
return v;
}
const suffix = ['B', 'KiB', 'MiB'];
const suffix = ['B', 'KB', 'MB'];
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,6 +8,15 @@
"value": "no-cache"
}
]
},
{
"source": "**/*.avif",
"headers": [
{
"key": "Content-Type",
"value": "image/avif"
}
]
}
],
"redirects": [{ "source": "/editor", "destination": "/" }]