Skip to content

Commit 843c9dc

Browse files
committed
docs: updated vision detect params/examples
1 parent 3cfc68c commit 843c9dc

2 files changed

Lines changed: 18 additions & 4 deletions

File tree

.jscsrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"requireCamelCaseOrUpperCaseIdentifiers": "ignoreProperties",
1818
"maximumLineLength": {
1919
"value": 80,
20-
"allowUrlComments": true
20+
"allowComments": true
2121
},
2222
"excludeFiles": [
2323
"system-test/data/*",

packages/vision/src/index.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,10 @@ Vision.prototype.annotate = function(requests, callback) {
157157
* For the response in the original format, review the `apiResponse` argument
158158
* your callback receives.
159159
*
160-
* @param {string|string[]|module:storage/file|module:storage/file[]} images -
161-
* The source image(s) to run the detection on. It can be either a local
162-
* image path, a remote image URL, or a @google-cloud/storage File object.
160+
* @param {string|string[]|buffer|buffer[]|module:storage/file|module:storage/file[]} images - The
161+
* source image(s) to run the detection on. It can be either a local image
162+
* path, a remote image URL, a Buffer, or a @google-cloud/storage File
163+
* object.
163164
* @param {string[]|object=} options - An array of types or a configuration
164165
* object.
165166
* @param {object=} options.imageContext - See an
@@ -211,6 +212,19 @@ Vision.prototype.annotate = function(requests, callback) {
211212
* vision.detect(img, types, function(err, detection, apiResponse) {});
212213
*
213214
* //-
215+
* // Run feature detection over a Buffer.
216+
* //-
217+
* var fs = require('fs');
218+
*
219+
* fs.readFile('image.jpg', function(err, contents) {
220+
* if (err) {
221+
* // Error handling omitted.
222+
* }
223+
*
224+
* vision.detect(contents, types, function(err, detection, apiResponse) {});
225+
* });
226+
*
227+
* //-
214228
* // Supply multiple images for feature detection.
215229
* //-
216230
* var images = [

0 commit comments

Comments
 (0)