mirror of
https://github.com/multipleof4/sune.git
synced 2026-09-18 19:45:43 +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];
|
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 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();
|
if (!f) return j();
|
||||||
const i = new Image;
|
const i = new Image;
|
||||||
i.onload = () => {
|
i.onload = () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user