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
|
node_modules
|
||||||
dbconfig.json
|
dbconfig.json
|
||||||
package-lock.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 = {
|
module.exports = {
|
||||||
name: "Google Safe Image",
|
name: "Google Safe Image",
|
||||||
init: (dclient) => {
|
init: (dclient) => {
|
||||||
@@ -44,9 +46,10 @@ async function detectSafeSearch(fileName, cb) {
|
|||||||
const vision = require('@google-cloud/vision');
|
const vision = require('@google-cloud/vision');
|
||||||
|
|
||||||
// Creates a client
|
// Creates a client
|
||||||
|
var pid = JSON.parse(fs.readFileSync("./googleapi.json")).project_id
|
||||||
const client = new vision.ImageAnnotatorClient({
|
const client = new vision.ImageAnnotatorClient({
|
||||||
projectId: 'causal-galaxy-207206',
|
projectId: pid,
|
||||||
keyFilename: 'C:/dev/myproject.json'
|
keyFilename: './googleapi.json'
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user