mirror of
https://github.com/misskey-dev/misskey
synced 2024-11-29 23:38:55 +09:00
Fix bug
This commit is contained in:
parent
2697107770
commit
0f7fbacb17
@ -242,6 +242,7 @@ export default async function(
|
|||||||
const calcAvg = async () => {
|
const calcAvg = async () => {
|
||||||
log('calculate average color...');
|
log('calculate average color...');
|
||||||
|
|
||||||
|
try {
|
||||||
const info = await (img as any).stats();
|
const info = await (img as any).stats();
|
||||||
|
|
||||||
const r = Math.round(info.channels[0].mean);
|
const r = Math.round(info.channels[0].mean);
|
||||||
@ -253,6 +254,7 @@ export default async function(
|
|||||||
const value = info.isOpaque ? [r, g, b] : [r, g, b, 255];
|
const value = info.isOpaque ? [r, g, b] : [r, g, b, 255];
|
||||||
|
|
||||||
properties['avgColor'] = value;
|
properties['avgColor'] = value;
|
||||||
|
} catch (e) { }
|
||||||
};
|
};
|
||||||
|
|
||||||
propPromises = [calcWh(), calcAvg()];
|
propPromises = [calcWh(), calcAvg()];
|
||||||
|
Loading…
Reference in New Issue
Block a user