forked from external-repos/squoosh
Compare commits
2 Commits
precise-un
...
avif-heade
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dab10d9940 | ||
|
|
b61f1ffbcf |
@@ -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) {
|
||||
|
||||
@@ -8,6 +8,15 @@
|
||||
"value": "no-cache"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"source": "**/*.avif",
|
||||
"headers": [
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "image/avif"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"redirects": [{ "source": "/editor", "destination": "/" }]
|
||||
|
||||
Reference in New Issue
Block a user