Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow Buffer as an input image for vision #1488

Merged
merged 3 commits into from
Aug 16, 2016

Conversation

calibr
Copy link
Contributor

@calibr calibr commented Aug 15, 2016

Hi! I think it would be useful if vision api could allow images as Buffers.
I've seen issue #1449, but I think Buffer is easier to detect than base64 string, I just use Buffer.isBuffer(image) and perhaps buffer is more natural way for passing binary data in node. I will be glad to make changes if something wrong with this patch

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@googlebot googlebot added the cla: no This human has *not* signed the Contributor License Agreement. label Aug 15, 2016
@callmehiphop callmehiphop added enhancement api: vision Issues related to the Cloud Vision API. labels Aug 15, 2016
@calibr
Copy link
Contributor Author

calibr commented Aug 15, 2016

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

@googlebot googlebot added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Aug 15, 2016
@callmehiphop
Copy link
Contributor

@calibr looks like there are a couple small linting issues, would you mind making those small changes?

You can lint locally via npm run lint

@calibr
Copy link
Contributor Author

calibr commented Aug 15, 2016

@callmehiphop of course, should I submit a fix in this merge request?

@callmehiphop
Copy link
Contributor

@calibr That would be perfect, we'll just squash the commits when we merge :)

@coveralls
Copy link

coveralls commented Aug 15, 2016

Coverage Status

Coverage remained the same at 100.0% when pulling b61cd47 on calibr:master into 66ac068 on GoogleCloudPlatform:master.

@@ -1281,6 +1281,14 @@ Vision.findImages_ = function(images, callback) {
images = arrify(images);

function findImage(image, callback) {
if (Buffer.isBuffer(image)) {
process.nextTick(function() {

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@coveralls
Copy link

coveralls commented Aug 15, 2016

Coverage Status

Coverage remained the same at 100.0% when pulling 74969dd on calibr:master into 66ac068 on GoogleCloudPlatform:master.

@calibr
Copy link
Contributor Author

calibr commented Aug 16, 2016

@callmehiphop is everything OK now with the patch?

@callmehiphop callmehiphop merged commit 0471d46 into googleapis:master Aug 16, 2016
@callmehiphop
Copy link
Contributor

@calibr yep, merged! Thanks!

@calibr
Copy link
Contributor Author

calibr commented Aug 16, 2016

@callmehiphop thanks! when the update is going to be on the npm?

@callmehiphop
Copy link
Contributor

I think closer to the end of the week

stephenplusplus pushed a commit to stephenplusplus/gcloud-node that referenced this pull request Aug 16, 2016
* allow Buffer as an input image for vision

* fix linting issues

* remove process.nextTick
@stephenplusplus
Copy link
Contributor

@callmehiphop can you add docs for this?

@callmehiphop
Copy link
Contributor

Sure!

stephenplusplus pushed a commit to stephenplusplus/gcloud-node that referenced this pull request Aug 23, 2016
* allow Buffer as an input image for vision

* fix linting issues

* remove process.nextTick
sofisl pushed a commit that referenced this pull request Jan 17, 2023
* allow Buffer as an input image for vision

* fix linting issues

* remove process.nextTick
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: vision Issues related to the Cloud Vision API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants