-
Notifications
You must be signed in to change notification settings - Fork 603
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
Conversation
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! |
CLAs look good, thanks! |
@calibr looks like there are a couple small linting issues, would you mind making those small changes? You can lint locally via |
@callmehiphop of course, should I submit a fix in this merge request? |
@calibr That would be perfect, we'll just squash the commits when we merge :) |
@@ -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.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@callmehiphop is everything OK now with the patch? |
@calibr yep, merged! Thanks! |
@callmehiphop thanks! when the update is going to be on the npm? |
I think closer to the end of the week |
* allow Buffer as an input image for vision * fix linting issues * remove process.nextTick
@callmehiphop can you add docs for this? |
Sure! |
* allow Buffer as an input image for vision * fix linting issues * remove process.nextTick
* allow Buffer as an input image for vision * fix linting issues * remove process.nextTick
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