-
Notifications
You must be signed in to change notification settings - Fork 21
Closed
googleapis/google-cloud-node
#4014Labels
type: docsImprovement to the documentation for an API.Improvement to the documentation for an API.
Description
I'm having trouble with an issue similar to issue googleapis/nodejs-vision#9
I have a base64 image string that I need to pass to vision.textDetection(), and nothing seems to work.
The issue that I've mentioned suggests the following:
Don't know if this should still be working for the most recent version, because this is what I'm doing:
const [textDetections] = await vision.textDetection(
{ image: {
source: {
content: imgBase64
}
}});
And this is what I'm getting:
{ Error: 3 INVALID_ARGUMENT: Request must specify image and features.
This is my base64 string (it seems fine):
Also tried the following:
const buffer = new Buffer(imgBase64, 'base64');
const arraybuffer = Uint8Array.from(buffer).buffer;
const [textDetections] = await vision.textDetection({image: {
// content: buffer // <--- TRIED BOTH WITH BUFFER AND ARRAY BUFFER
content: arraybuffer
}});
Nothing seems to work.
Also, the docs don't mention anything about it accepting a base64 string.
https://googleapis.dev/nodejs/vision/latest/v1.ImageAnnotatorClient.html#textDetection
Environment details
- OS: Firebase Cloud Function Node v10
- Node.js version: 10
- npm version: NA
@google-cloud/visionversion: "@google-cloud/vision": "^2.1.1",
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
type: docsImprovement to the documentation for an API.Improvement to the documentation for an API.


