我很難重新創建這個例子。我得到以下輸出:2019-08-19T17:19:24.531 [信息] 正在執行“Functions.PdfToTiffConverter”(原因='EventGrid 觸發器在 2019-08-19T17:19:24.4859961+00:00'-f9552000'-f95525520 -a9ca7e0daf91) 2019-08-19T17:20:26.112 [信息] 錯誤:w 和 h 必須是 Jimp.throwError 處的數字 (D:\home\site\wwwroot\node_modules@jimp\utils\dist\index.js:26 :13) 在 Jimp.resize (D:\home\site\wwwroot\node_modules@jimp\plugin-resize\dist\index.js:38:36) 在 Jimp.read.then (D:\home\site\wwwroot \PdfToTiffConverter\index.js:14:19)這是我的function.json:{ "disabled": false, "bindings": [ { "type": "eventGridTrigger", "name": "myEvent", "direction": "in" }, { "name": "myBlob", "type": "blob", "direction": "in", "path": "{data.url}", "connection": "AZURE_STORAGE_CONNECTION_STRING", "datatype": "binary" } ]}這是我正在使用的代碼:const stream = require('stream');const Jimp = require('jimp');const storage = require('azure-storage');const blobService = storage.createBlobService();module.exports = (context, myEvent, myBlob) => { const widthInPixels = process.env.THUMBNAIL_WIDTH; const blobName = myEvent.subject.split('/')[6]; Jimp.read(myBlob).then((thumbnail) => { thumbnail.resize(widthInPixels, Jimp.AUTO); thumbnail.getBuffer(Jimp.MIME_PNG, (err, buffer) => { const readStream = stream.PassThrough(); readStream.end(buffer); blobService.createBlockBlobFromStream('thumbnails', blobName, readStream, buffer.length, (err) => { context.done(); }); }); }).catch(context.log);};我究竟做錯了什么?為什么我會收到此異常?
w 和 h 必須是數字
幕布斯6054654
2021-09-17 10:25:44