vision.detectText() chokes when handed a URI presented by google drive v3 in webviewLink format obtained from drive.files.get()
my webViewLink grabber is:
drive.files.get({
auth: auth,
fileId: options.fileID,
//fields: 'webContentLink' // <-- downloads the file
fields: 'webViewLink' // <-- "views" the file
},function(err, response) {}
response.webViewLink is in the format:
https://drive.google.com/file/d/0Bw4DMtLCtPMkOTlXR1l4Nkw1WGs/view?usp=drivesdk
vision.detectText(response.webViewLink) chokes with:
ERROR: { PartialFailureError: A failure occurred during this request.
at /Users/node_modules/@google-cloud/vision/src/index.js:434:15
at /Users/node_modules/@google-cloud/vision/src/index.js:126:5
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
errors:
[ { image: 'https://drive.google.com/file/d
/0Bw4DMtLCtPMkOTlXR1l4Nkw1WGs/view?usp=drivesdk',
errors: [Object] } ],
response: { responses: [ [Object] ] },
message: 'A failure occurred during this request.' }
replacing that webViewLink URI with a 'traditional' form (like http://www.identifont.com/samples/houseindustries/NeutraText.gif) works fine.
Please note that https://cloud.google.com/vision/docs/request#providing_the_image sez that "You can provide the image in your request ... As a publicly-accessible HTTP or HTTPS URL".
Should the Drive v3 webViewLink format count as "publicly-accessible" for vision.detectText()?
If not, how should this format be modified to be acceptable to vision.detectText() to support evaluation of images hosted by google drive?
webContentLink
return? Is that a file URL? – Mike Jeffrey