Skip to content

Commit 991b49b

Browse files
committed
Add region tags to ImageMagick sample.
1 parent bd96cde commit 991b49b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

functions/imagemagick/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,15 @@
1515

1616
'use strict';
1717

18+
// [START functions_imagemagick_setup]
1819
const exec = require('child_process').exec;
1920
const fs = require('fs');
2021
const path = require('path');
2122
const storage = require('@google-cloud/storage')();
2223
const vision = require('@google-cloud/vision')();
24+
// [END functions_imagemagick_setup]
2325

26+
// [START functions_imagemagick_analyze]
2427
// Blurs uploaded images that are flagged as Adult or Violence.
2528
exports.blurOffensiveImages = (event) => {
2629
const object = event.data;
@@ -52,7 +55,9 @@ exports.blurOffensiveImages = (event) => {
5255
}
5356
});
5457
};
58+
// [END functions_imagemagick_analyze]
5559

60+
// [START functions_imagemagick_blur]
5661
// Blurs the given file using ImageMagick.
5762
function blurImage (file) {
5863
const tempLocalFilename = `/tmp/${path.parse(file.name).base}`;
@@ -103,3 +108,4 @@ function blurImage (file) {
103108
});
104109
});
105110
}
111+
// [END functions_imagemagick_blur]

0 commit comments

Comments
 (0)