File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 1515
1616'use strict' ;
1717
18+ // [START functions_imagemagick_setup]
1819const exec = require ( 'child_process' ) . exec ;
1920const fs = require ( 'fs' ) ;
2021const path = require ( 'path' ) ;
2122const storage = require ( '@google-cloud/storage' ) ( ) ;
2223const 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.
2528exports . 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.
5762function 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]
You can’t perform that action at this time.
0 commit comments