我正在从Google云存储中设置带有图像URL的Microsoft Azure的计算机视觉,但是每当我从Google云存储中上传照片时,响应都是“ InvalidImageFormat”,但是当我使用除Google云存储之外的图像URL时,它有效
我尝试更改网址并检查上传的图片的尺寸是否大于最大限制大小,但小于最大限制大小
const cognitiveServices = require('cognitive-services');
const fs = require('fs')
const parameters = {
'visualFeatures': 'Description',
'language': 'en'
};
const body = {"url" :'<from google storage>'}
const headers = { "content-type": "application/json" };
const checkImage = new cognitiveServices.computerVision({
apiKey: "<api key>",
endpoint: "<end point>"
})
checkImage.analyzeImage({
parameters,
body,
headers
}).then(response => {
console.log(response);
}).catch(error => {
console.log(error)
})
我希望输出给出200响应,而不给出'InvalidImageFormat'的400状态代码