docs: updated vision detect params/examples#1500
docs: updated vision detect params/examples#1500stephenplusplus merged 2 commits intogoogleapis:masterfrom callmehiphop:vision-buffer-docs
Conversation
| * @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.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
@stephenplusplus WDYT? |
|
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. |
|
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) {});
}); |
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) {});
}); |
|
@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. |
| }); | ||
| }); | ||
| }; | ||
| // jscs:enable maximumLineLength |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
@stephenplusplus @calibr updated the example, PTAL |
* docs: updated vision detect params/examples * updated buffer example
* fix: remove dep on is package * fix: remove other is usages * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Relates to #1488 (comment)