mirror of
https://github.com/sune-org/sune.git
synced 2026-09-18 04:45:42 +00:00
refactor(utils): update imgToWebp defaults to D=96 and q=75
This commit is contained in:
@@ -16,7 +16,7 @@ export const fmtSize = b => {
|
||||
return (x >= 10 ? Math.round(x) : Math.round(x * 10) / 10) + ' ' + u[i];
|
||||
};
|
||||
export const asDataURL = f => new Promise(r => { const fr = new FileReader(); fr.onload = () => r(String(fr.result || '')); fr.readAsDataURL(f); });
|
||||
export const imgToWebp = (f, D = 128, q = 80) => new Promise((r, j) => {
|
||||
export const imgToWebp = (f, D = 96, q = 75) => new Promise((r, j) => {
|
||||
if (!f) return j();
|
||||
const i = new Image;
|
||||
i.onload = () => {
|
||||
|
||||
Reference in New Issue
Block a user