【发布时间】:2020-07-28 14:11:58
【问题描述】:
此图像缩略图生成器功能在将图像上传到 blob 容器时触发并且工作正常但我不知道如何为视频执行相同的过程!
var Jimp = require("jimp");
module.exports = (context, myBlob) => {
// Read image with Jimp
Jimp.read(myBlob).then((image) => {
// Manipulate image
image
.resize(200, Jimp.AUTO)
.greyscale()
.getBuffer(Jimp.MIME_JPEG, (error, stream) => {
// Check for errors
if (error) {
context.log(`There was an error processing the image.`);
context.done(error);
}
else {
context.log(`Successfully processed the image`);
// Bind the stream to the output binding to create a new blob
context.done(null, stream);
}
});
});
};
【问题讨论】:
-
这个答案有帮助吗? stackoverflow.com/a/8804408/7743705
标签: node.js azure containers azure-functions devops