Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions functions/ocr/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ function renameImageForSave (filename, lang) {

// [START functions_ocr_process]
/**
* Cloud Function triggered by Cloud Storage when a file is uploaded.
* This function is exported by index.js, and is executed when
* a file is uploaded to the Cloud Storage bucket you created
* for uploading images.
*
* @param {object} event The Cloud Functions event.
* @param {object} event.data A Google Cloud Storage File object.
Expand Down Expand Up @@ -136,8 +138,10 @@ exports.processImage = (event) => {

// [START functions_ocr_translate]
/**
* Translates text using the Google Translate API. Triggered from a message on
* a Pub/Sub topic.
* This function is exported by index.js, and is executed when
* a message is published to the Cloud Pub/Sub topic specified
* by the TRANSLATE_TOPIC value in the config.json file. The
* function translates text using the Google Translate API.
*
* @param {object} event The Cloud Functions event.
* @param {object} event.data The Cloud Pub/Sub Message object.
Expand Down Expand Up @@ -186,8 +190,10 @@ exports.translateText = (event) => {

// [START functions_ocr_save]
/**
* Saves the data packet to a file in GCS. Triggered from a message on a Pub/Sub
* topic.
* This function is exported by index.js, and is executed when
* a message is published to the Cloud Pub/Sub topic specified
* by the RESULT_TOPIC value in the config.json file. The
* function saves the data packet to a file in GCS.
*
* @param {object} event The Cloud Functions event.
* @param {object} event.data The Cloud Pub/Sub Message object.
Expand Down