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

docs: updated vision detect params/examples #1500

Merged
merged 2 commits into from
Aug 29, 2016
Merged

docs: updated vision detect params/examples #1500

merged 2 commits into from
Aug 29, 2016

Conversation

callmehiphop
Copy link
Contributor

Relates to #1488 (comment)

@callmehiphop callmehiphop added docs api: vision Issues related to the Cloud Vision API. labels Aug 16, 2016
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Aug 16, 2016
* @param {string|string[]|module:storage/file|module:storage/file[]} images -
* The source image(s) to run the detection on. It can be either a local
* image path, a remote image URL, or a @google-cloud/storage File object.
* @param {string|string[]|buffer|buffer[]|module:storage/file|module:storage/file[]} images - The

This comment was marked as spam.

This comment was marked as spam.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 843c9dc on callmehiphop:vision-buffer-docs into 3cfc68c on GoogleCloudPlatform:master.

@callmehiphop
Copy link
Contributor Author

@stephenplusplus WDYT?

@stephenplusplus
Copy link
Contributor

I think we just need a different example (#1500 (comment)). Sorry that I'm struggling to come up with something specific to suggest... the only thing is that it shouldn't confuse people into thinking they have to use fs.readFile() to have an image on disk run through feature detection.

@calibr
Copy link
Contributor

calibr commented Aug 19, 2016

I think that there are many sorts of buffers sources, like DBs, remote services, incoming http requests, etc., IMHO doc shouldn't describe all these sources and maybe example should be transformed to a common form of getting buffer like:

getBufferFromSomewhere(function(err, buffer) {
  vision.detect(buffer, types, function(err, detection, apiResponse) {});
});

@stephenplusplus
Copy link
Contributor

var db = require('level')('./users-database');

db.get('user-image', { encoding: 'binary' }, function(err, img) {
  if (err) {
    // Error handling omitted.
  }

  vision.detect(img, function(err, detection, apiResponse) {});
});

@callmehiphop
Copy link
Contributor Author

@stephenplusplus WDYT about using @calibr's example? IIRC a lot of our customers use AWS services as well, so I think it has the added benefit of being a common use case.

@stephenplusplus
Copy link
Contributor

Let's see if @jgeewax or @omaray has a preference of which example best demonstrates passing a Buffer with our library off to Vision's feature detection.

@@ -519,6 +535,7 @@ Vision.prototype.detect = function(images, options, callback) {
});
});
};
// jscs:enable maximumLineLength

This comment was marked as spam.

@callmehiphop
Copy link
Contributor Author

@stephenplusplus @calibr updated the example, PTAL

@stephenplusplus stephenplusplus merged commit 353d9f2 into googleapis:master Aug 29, 2016
sofisl pushed a commit that referenced this pull request Jan 17, 2023
* docs: updated vision detect params/examples

* updated buffer example
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