Closed ChoyCheeWei closed 5 years ago
👋 @ChoyCheeWei are you trying to use this on the front end? Currently this library doesn't support it, but I think we'll have a release out soon that will.
@callmehiphop I'm trying to get all the text from an image and store some of the text into database, but I already face some errors during my first step lol
@ChoyCheeWei the latest release should have browser support if you'd like to try updating the client version and testing again.
@alexander-fenster is there a canonical issue @callmehiphop, myself, and others can link folks to, related to browser support?
Maybe this one: https://github.com/googleapis/google-cloud-node/issues/2933
For Vision, helpers.js
is a manual code that might also need to be updated to start using JSON protos (I haven't checked it yet).
This piece of code needs to be changed to use JSON protos. I will work on this.
I try to implement Google Vision Api in Vuejs but I getting this error:
helpers.js?cd8a:247 Uncaught TypeError: gax.GoogleProtoFilesRoot is not a constructor
this code is in my ocr.vue file
<script>
export default {
name: "ocr"
};
// Imports the Google Cloud client library
const vision = require("@google-cloud/vision");
// Creates a client
const client = new vision.ImageAnnotatorClient();
// Performs label detection on the image file
client
.textDetection('./resources/maybank2u.png')
.then(result => {
const labels = result[0].textAnnotations;
console.log("Text:");
labels.forEach(text => console.log(text));
})
.catch(err => {
console.error("ERROR:", err);
});
</script>
Any idea how to solve this?