fix(server): 特定のPNG画像のアップロードに失敗する問題を修正

Co-Authored-By: haru <64310155+usbharu@users.noreply.github.com>
This commit is contained in:
syuilo
2023-01-09 14:03:22 +09:00
parent 403849805a
commit 3cfd017538
2 changed files with 3 additions and 2 deletions

View File

@@ -398,13 +398,13 @@ export class FileInfoService {
.raw()
.ensureAlpha()
.resize(64, 64, { fit: 'inside' })
.toBuffer((err, buffer, { width, height }) => {
.toBuffer((err, buffer, info) => {
if (err) return reject(err);
let hash;
try {
hash = encode(new Uint8ClampedArray(buffer), width, height, 5, 5);
hash = encode(new Uint8ClampedArray(buffer), info.width, info.height, 5, 5);
} catch (e) {
return reject(e);
}