当前位置 : 主页 > 网页制作 > Nodejs >

node.js – Google Cloud Vision API – 错误:名称太长

来源:互联网 收集:自由互联 发布时间:2021-06-16
我试图将Base64编码的图像传递给vision.detectText. var image = new Buffer(mark.image.replace(/^data:image\/\w+;base64,/, '')).toString('base64'); 要么 var image = mark.image.replace(/^data:image\/\w+;base64,/, ''); 但是,我和工
我试图将Base64编码的图像传递给vision.detectText.

var image = new Buffer(mark.image.replace(/^data:image\/\w+;base64,/, '')).toString('base64');

要么

var image = mark.image.replace(/^data:image\/\w+;base64,/, '');

但是,我和工作都没有收到此错误:

Error: ENAMETOOLONG: name too long, open 'aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQVpBQUFBRXNDQUlBQUFCaTFYS1ZBQUFBQkdkQlRVRUFBTEdQQy94aEJRQUFBQ0JqU0ZKTkFBQjZKZ0FBZ0lRQUFQb0FBQUNBNkFBQWRUQUFBT3BnQUFBNm1BQUFGM0NjdWxFOEFBQUFCbUpMUjBRQS93RC9BUCtndmFlVEFBQUFCM1JKVFVVSDRBUUhDQVV1SFhXSGFRQUFLQ2RKUkVGVWVOcnRuUWRVVk5mYTk4MU4xdnZkOTY3MWZlOTk3NzJKTmRGRUlZQ3A1aVpSTEFoVEdRYm16QXlJTGZZYUUxczB0c1NvMFZnd2xoZzFKckhFUkkySjNhakFEQjNzQld5Z1lsZnNvbEtrei9mc3M1bmhNQVBJSU9CNDgvK3R2V1lOTTRkaHp0SDlXOC96bkYwYVdBQUE0Q21oQVM0QkFBRENBZ0FBQ0FzQUFHRUJBQUNFQlFBQUVCWUFBTUlDQUFBSUN3QUFJQ3dBQUlRRkFBQVFGZ0FBUUZnQUFBZ0xBQUFnTEFBQWdMQUFBQkFXQUFCQVdBQUFBR0VCQUNBc0FBQ0FzQUFBQU1JQ0FFQllBQUFBWVFFQUFJUUZBSUN3QUFBQXdnSUFBQWdMQUFCaEFRQUFoQVVBZ0xBQUFBRENBZ0FBQ0FzQUFHRUJBQUNFQlFBQUVCWUF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hQNmg3S0ZwbEZJaDBBQUFBbGRFVllkR1JoZEdVNlkzSmxZWFJsQURJd01UWXRNRFF0TURkVU1EZzZNRFU2TkRZdE1EUTZNREFla3FkN0FBQUFKWFJGV0hSa1lYUmxPbTF2WkdsbWVRQXlNREUyTFRBMExUQTNWREE0T2pBMU9qUTJMVEEwT2pBd2I4OGZ4d0FBQUJsMFJWaDBVMjltZEhkaGNtVUFRV1J2WW1VZ1NXMWhaMlZTWldGa2VYSEpaVHdBQUFBQVNVVk9SSzVDWUlJPQ=='

根据Vision的Best Practices,支持Base64编码的字符串.

不确定当时的文档是否不同但是… nodejs客户端需要一个缓冲区,所以这应该工作:

const fs = require('fs');
 const file = fs.readFileSync('myimage.jpg');
 vision.textDetection({ content: file })
     .then((results) => console.log(results))
     .catch((err) => console.log(err));

无需将其传递给base64格式.如果使用REST API,您只需要这样做.

如果您使用的是s3,则getObject已经为您提供了缓冲区

var params = {
  Bucket: bucket,
  Key: path
};
s3.getObject(params, function (err, data) {
  if (err)
    console.log(err);
 vision.textDetection({ content: s3.body })
     .then((results) => console.log(results))
     .catch((err) => console.log(err));
});

Cloud vision documentation for nodejs client

网友评论