mirror of
https://github.com/litruv/DAdmin.git
synced 2026-07-24 02:36:11 +10:00
safeimage changes
doesn't work on ubuntu, use docker
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,3 +1,5 @@
|
||||
node_modules
|
||||
dbconfig.json
|
||||
package-lock.json
|
||||
|
||||
googleapi\.json
|
||||
|
||||
1064
package-lock.json
generated
1064
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,3 +1,5 @@
|
||||
const fs = require("fs")
|
||||
|
||||
module.exports = {
|
||||
name: "Google Safe Image",
|
||||
init: (dclient) => {
|
||||
@@ -44,9 +46,10 @@ async function detectSafeSearch(fileName, cb) {
|
||||
const vision = require('@google-cloud/vision');
|
||||
|
||||
// Creates a client
|
||||
var pid = JSON.parse(fs.readFileSync("./googleapi.json")).project_id
|
||||
const client = new vision.ImageAnnotatorClient({
|
||||
projectId: 'causal-galaxy-207206',
|
||||
keyFilename: 'C:/dev/myproject.json'
|
||||
projectId: pid,
|
||||
keyFilename: './googleapi.json'
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user