Skip to content
This repository was archived by the owner on Jul 20, 2023. It is now read-only.
This repository was archived by the owner on Jul 20, 2023. It is now read-only.

Using Buffer doesn't work  #9

@Khalid-Nowaf

Description

@Khalid-Nowaf

Environment details

  • OS: OSX
  • Node.js version: v6.11.4
  • npm version: 3.10.10
  • @google-cloud/vision version: ^0.13.0

Steps to reproduce

I have a firebase function, that accepts base64 string, then convert it to buffer.
Everything runs with no problem, but the response from Vision API is always an empty array. I pass the same image with the file path, I got a correct response.

here my is an example

// req.base64data is a string from the client using FileReader API 
client
  .faceDetection( new Buffer(req.base64data,'base64'))
  .then(results => {
    const faces = results[0].faceAnnotations;
        console.log("RESULT:", faces.length);
        return res.send({data:faces.length});
  })
  .catch(err => {
    console.error('ERROR:', err);
  });
```

Thanks!

Metadata

Metadata

Labels

🚨This issue needs some love.api: visionIssues related to the googleapis/nodejs-vision API.triage meI really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions