.. 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) => { export default async (opts: any) => {
let out = await sharp(opts.buffer, { raw: GetRawSharpOptions(opts.size) }) try {
.resize(kThumbnailSize.width, kThumbnailSize.height, { fit: 'fill' }) console.log(opts)
.jpeg({ let out = await sharp(opts.buffer, { raw: GetRawSharpOptions(opts.size) })
quality: opts.quality || 75 .resize(kThumbnailSize.width, kThumbnailSize.height, { fit: 'fill' })
}) .jpeg({
.toFormat('jpeg') quality: opts.quality || 75
.toBuffer(); })
.toFormat('jpeg')
.toBuffer();
return out;
} catch {
return;
}
return Piscina.move(out);
}; };