diff options
| author | syuilo <4439005+syuilo@users.noreply.github.com> | 2024-08-10 21:07:33 +0900 |
|---|---|---|
| committer | syuilo <4439005+syuilo@users.noreply.github.com> | 2024-08-10 21:07:33 +0900 |
| commit | 93c569c2cd506c8c18c208135904ef0ff5aae378 (patch) | |
| tree | 12261bfc00792dbba8eb737f9f05251c2a0a283d /packages/backend/src/core/FileInfoService.ts | |
| parent | ci: skip chromatic / storybook CI for pull requests targets master (#14377) (diff) | |
| download | sharkey-93c569c2cd506c8c18c208135904ef0ff5aae378.tar.gz sharkey-93c569c2cd506c8c18c208135904ef0ff5aae378.tar.bz2 sharkey-93c569c2cd506c8c18c208135904ef0ff5aae378.zip | |
refactor
Diffstat (limited to 'packages/backend/src/core/FileInfoService.ts')
| -rw-r--r-- | packages/backend/src/core/FileInfoService.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/backend/src/core/FileInfoService.ts b/packages/backend/src/core/FileInfoService.ts index 169285f033..6bd6cb8d9b 100644 --- a/packages/backend/src/core/FileInfoService.ts +++ b/packages/backend/src/core/FileInfoService.ts @@ -15,7 +15,7 @@ import isSvg from 'is-svg'; import probeImageSize from 'probe-image-size'; import { type predictionType } from 'nsfwjs'; import { sharpBmp } from '@misskey-dev/sharp-read-bmp'; -import { encode } from 'blurhash'; +import * as blurhash from 'blurhash'; import { createTempDir } from '@/misc/create-temp.js'; import { AiService } from '@/core/AiService.js'; import { LoggerService } from '@/core/LoggerService.js'; @@ -452,7 +452,7 @@ export class FileInfoService { } /** - * Calculate average color of image + * Calculate blurhash string of image */ @bindThis private getBlurhash(path: string, type: string): Promise<string> { @@ -467,7 +467,7 @@ export class FileInfoService { let hash; try { - hash = encode(new Uint8ClampedArray(buffer), info.width, info.height, 5, 5); + hash = blurhash.encode(new Uint8ClampedArray(buffer), info.width, info.height, 5, 5); } catch (e) { return reject(e); } |