diff options
| author | dakkar <dakkar@thenautilus.net> | 2024-08-30 12:08:31 +0100 |
|---|---|---|
| committer | dakkar <dakkar@thenautilus.net> | 2024-08-30 12:08:31 +0100 |
| commit | 6151099f5ba07d14a651aea8f816dd280d74209d (patch) | |
| tree | 4b014a2f4b198facc8bdd92c70b49fec2801d51a /packages/backend/src/core/FileInfoService.ts | |
| parent | merge: thunk the min/max promises (!603) (diff) | |
| parent | Merge pull request #14391 from misskey-dev/develop (diff) | |
| download | sharkey-6151099f5ba07d14a651aea8f816dd280d74209d.tar.gz sharkey-6151099f5ba07d14a651aea8f816dd280d74209d.tar.bz2 sharkey-6151099f5ba07d14a651aea8f816dd280d74209d.zip | |
Merge remote-tracking branch 'misskey/master' into feature/misskey-2024.8
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 9a9eae3cae..cc66e9fe3a 100644 --- a/packages/backend/src/core/FileInfoService.ts +++ b/packages/backend/src/core/FileInfoService.ts @@ -12,7 +12,7 @@ import FFmpeg from 'fluent-ffmpeg'; import isSvg from 'is-svg'; import probeImageSize from 'probe-image-size'; import { sharpBmp } from '@misskey-dev/sharp-read-bmp'; -import { encode } from 'blurhash'; +import * as blurhash from 'blurhash'; import { LoggerService } from '@/core/LoggerService.js'; import type Logger from '@/logger.js'; import { bindThis } from '@/decorators.js'; @@ -283,7 +283,7 @@ export class FileInfoService { } /** - * Calculate average color of image + * Calculate blurhash string of image */ @bindThis private getBlurhash(path: string, type: string): Promise<string> { @@ -298,7 +298,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); } |