Code Monkey home page Code Monkey logo

fireimgoptimizer's People

Contributors

kriptontr avatar snyk-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

ldippo nicktunac

fireimgoptimizer's Issues

Sharp resize takes so long.

I tried to deploy this function using sharp as resizer, but it seems it takes to long to convert the file. Around ~2 mins.

Is it better to use imagemagick cli instead?

Problem deploying the function to firebase

Hi,

first, thank you very much for this tool. It is very useful.

I added the function to my index.js, and I saved the fireImgOptimizer to the same folder as my index.js. I adjusted my package.json as yours, executed npm install successfully (after installing visual studio and C++).

But when deploying the function to firebase the following exception happens:

functions>firebase deploy --only functions

=== Deploying to 'whereareyou-fdb0a'...

i  deploying functions
i  functions: ensuring necessary APIs are enabled...
i  runtimeconfig: ensuring necessary APIs are enabled...
+  runtimeconfig: all necessary APIs are enabled
+  functions: all necessary APIs are enabled
i  functions: preparing functions directory for uploading...
i  functions: packaged functions (25.16 KB) for uploading
+  functions: functions folder uploaded successfully
i  starting release process (may take several minutes)...
i  functions: creating function imgOptimizer...
i  functions: updating function sendPushNotification...
!  functions[imgOptimizer]: Deploy Error: Function load error: Code in file index.js can't be loaded.
Is there a syntax error in your code?
Detailed stack trace: Error: libvips-cpp.so.42: cannot open shared object file: No such file or directory
    at Error (native)
    at Object.Module._extensions..node (module.js:597:18)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/user_code/node_modules/sharp/lib/constructor.js:8:15)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
!  functions[sendPushNotification]: Deploy Error: Function load error: Code in file index.js can't be loaded.
Is there a syntax error in your code?
Detailed stack trace: Error: libvips-cpp.so.42: cannot open shared object file: No such file or directory
    at Error (native)
    at Object.Module._extensions..node (module.js:597:18)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/user_code/node_modules/sharp/lib/constructor.js:8:15)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)

Thats the code that I added to my index.js

let thumbConfig = {
    imagePath:"/images",
    sizes:{w:180,h:180},
    naming:{postfix:"_180x180",prefix:"thumb_"}
};
exports.imgOptimizer = require("./fireImgOptimizer")(thumbConfig);

May you help me?

Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.