.. 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,6 +19,8 @@ function GetRawSharpOptions(size: Size): sharp.CreateRaw {
} }
export default async (opts: any) => { export default async (opts: any) => {
try {
console.log(opts)
let out = await sharp(opts.buffer, { raw: GetRawSharpOptions(opts.size) }) let out = await sharp(opts.buffer, { raw: GetRawSharpOptions(opts.size) })
.resize(kThumbnailSize.width, kThumbnailSize.height, { fit: 'fill' }) .resize(kThumbnailSize.width, kThumbnailSize.height, { fit: 'fill' })
.jpeg({ .jpeg({
@@ -27,5 +29,9 @@ export default async (opts: any) => {
.toFormat('jpeg') .toFormat('jpeg')
.toBuffer(); .toBuffer();
return Piscina.move(out); return out;
} catch {
return;
}
}; };