Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update exif-images - deps and gcp storage import #738

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
Update exif-images example to use gcp storage 5.1.0 firebase-admin 8.…
…12.1 and fb functions 3.7.0
  • Loading branch information
NickFoden committed Jun 16, 2020
commit c75a2941f96b8f8055706c3443816aeb8b1189aa
5 changes: 3 additions & 2 deletions exif-images/functions/index.js
Original file line number Diff line number Diff line change
@@ -23,7 +23,8 @@ const os = require('os');

const admin = require('firebase-admin');
admin.initializeApp();
const gcs = require('@google-cloud/storage')();
const { Storage } = require("@google-cloud/storage");
const storage = new Storage();
const spawn = require('child-process-promise').spawn;

/**
@@ -45,7 +46,7 @@ exports.metadata = functions.storage.object().onFinalize(async (object) => {

let metadata;
// Download file from bucket.
const bucket = gcs.bucket(object.bucket);
const bucket = storage.bucket(object.bucket);
await bucket.file(filePath).download({destination: tempLocalFile});
// Get Metadata from image.
const result = await spawn('identify', ['-verbose', tempLocalFile], {capture: ['stdout', 'stderr']});
8 changes: 4 additions & 4 deletions exif-images/functions/package.json
Original file line number Diff line number Diff line change
@@ -2,10 +2,10 @@
"name": "exif-images-functions",
"description": "Extract EXIF metadata from images Firebase Functions sample",
"dependencies": {
"@google-cloud/storage": "^4.3.1",
"@google-cloud/storage": "^5.1.0",
"child-process-promise": "^2.2.1",
"firebase-admin": "~8.9.2",
"firebase-functions": "^3.3.0"
"firebase-admin": "^8.12.1",
"firebase-functions": "^3.7.0"
},
"devDependencies": {
"eslint": "^6.8.0",
@@ -20,7 +20,7 @@
"logs": "firebase functions:log"
},
"engines": {
"node": "8"
"node": "10"
},
"private": true
}