mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-13 17:27:09 +00:00
Compare commits
2 Commits
precise-un
...
avif-heade
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dab10d9940 | ||
|
|
b61f1ffbcf |
@@ -19,11 +19,11 @@ function clamp(v, min, max) {
|
|||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
const suffix = ['B', 'KiB', 'MiB'];
|
const suffix = ['B', 'KB', 'MB'];
|
||||||
function prettyPrintSize(size) {
|
function prettyPrintSize(size) {
|
||||||
const base = Math.floor(Math.log2(size) / 10);
|
const base = Math.floor(Math.log2(size) / 10);
|
||||||
const index = clamp(base, 0, 2);
|
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) {
|
async function decodeFile(file) {
|
||||||
|
|||||||
@@ -8,6 +8,15 @@
|
|||||||
"value": "no-cache"
|
"value": "no-cache"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"source": "**/*.avif",
|
||||||
|
"headers": [
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "image/avif"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"redirects": [{ "source": "/editor", "destination": "/" }]
|
"redirects": [{ "source": "/editor", "destination": "/" }]
|
||||||
|
|||||||
Reference in New Issue
Block a user