.. ok, i guess one node buffer can't be moved but the other magically can.

This commit is contained in:
modeco80
2024-04-24 04:38:47 -04:00
parent a904f26961
commit e03bf57ede

View File

@@ -19,13 +19,19 @@ function GetRawSharpOptions(size: Size): sharp.CreateRaw {
}
export default async (opts: any) => {
let out = await sharp(opts.buffer, { raw: GetRawSharpOptions(opts.size) })
.resize(kThumbnailSize.width, kThumbnailSize.height, { fit: 'fill' })
.jpeg({
quality: opts.quality || 75
})
.toFormat('jpeg')
.toBuffer();
try {
console.log(opts)
let out = await sharp(opts.buffer, { raw: GetRawSharpOptions(opts.size) })
.resize(kThumbnailSize.width, kThumbnailSize.height, { fit: 'fill' })
.jpeg({
quality: opts.quality || 75
})
.toFormat('jpeg')
.toBuffer();
return out;
} catch {
return;
}
return Piscina.move(out);
};