Skip to content

Commit

Permalink
enhance(backend): blurhash生成時、リサイズしてからRawに変換するように (#832)
Browse files Browse the repository at this point in the history
  • Loading branch information
u1-liquid authored Dec 18, 2024
1 parent b3f73d7 commit 08a53cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/backend/src/core/FileInfoService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -457,9 +457,9 @@ export class FileInfoService {
private async getBlurhash(path: string, type: string): Promise<string> {
const sharp = await sharpBmp(path, type);
const { data, info } = await sharp
.raw()
.ensureAlpha()
.resize(64, 64, { fit: 'inside' })
.ensureAlpha()
.raw()
.toBuffer({ resolveWithObject: true });

return encode(new Uint8ClampedArray(data), info.width, info.height, 5, 5);
Expand Down

0 comments on commit 08a53cd

Please sign in to comment.