GithubHelp home page GithubHelp logo

jimp-native's People

Contributors

liarco avatar sjoerd108 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

liarco

jimp-native's Issues

Add support for `getBuffer`/`getBufferAsync`

It looks like these functions are brought it from Jimp's core, but a fairly simple .png encoding (using getBufferAsync) appears to take a few hundred milliseconds in my application and is becoming a pretty big bottleneck.

Sorry to just request features and not be implementing them, but thought I'd call this one out as one that's slow in Jimp-land as well.

Build Errors when trying to install via NPM

Hello when trying to install, i receive the following error from npm

crop.obj : error LNK2019: unresolved external symbol "double __cdecl diff(unsigned char *,unsigned char *)" (?diff@@YANPEAE0@Z) referenced in function "void __cdecl autocrop(class Image &,long,double,bool,bool,bool,bool,bool,bool,long &,long &)" (?autocrop@@YAXAEAVImage@@JN_N11111AEAJ2@Z)[C:\...\node_modules\jimp-native\build\jimp-native.vcxproj]
image.obj : error LNK2019: unresolved external symbol "void __cdecl clipColour(struct ColourFP &)" (?clipColour@@YAXAEAUColourFP@@@Z) referenced in function "public: void __cdecl Image::setColourAt(long,long,struct ColourFP,enum EdgeHandling)" (?setColourAt@Image@@QEAAXJJUColourFP@@W4EdgeHandling@@@Z) [C:\...\node_modules\jimp-native\build\jimp-native.vcxproj]
C:\...\node_modules\jimp-native\build\Release\jimp-native.node : fatal error LNK1120: 2 unresolved externals [C:\...\node_modules\jimp-native\build\jimp-native.vcxproj]

gyp ERR! build error 
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:375:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Windows_NT 10.0.19042
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\zy\Documents\GitHub\e-notes\backend\node_modules\jimp-native
gyp ERR! node -v v14.17.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok

Improve testing

Currenty jimp native is only tested through comparing the output of any given image operation to the upstream library. Some things that could be done to improve the stability of this library:

  • Test JS glue code
  • Unit test C++ implementations using a C++ test runner
  • Test asyncified versions of calls better as some have extra logic to deal with running async that currently goes untested

WASMified version

Porting Jimp-native to WASM would be very useful as it would:

  • Allow people to run jimp-native without having to compile the C++ sources during npm install
  • Allow jimp-native to be used within the browser
  • Be a bit safer when it comes to memory management

Part of the effort has already been done when moving to lerna, as all C++ code has been separated into a pure implementation and node addon API glue code.

Ubuntu Build error

Hey, I've got this error (Ubuntu 16.04)
Node Version: v16.14.0
NPM Version: v9.3.0
Node-Gyp Version: v9.3.1

npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! In file included from ../cppsrc/js-wrappers/../modules/blit.hpp:2:0,
npm ERR! from ../cppsrc/js-wrappers/wrapBlit.cpp:2:
npm ERR! ../cppsrc/js-wrappers/../modules/../util/image.hpp:4:20: fatal error: optional: No such file or directory
npm ERR! compilation terminated.
npm ERR! make: *** [Release/obj.target/jimp-native/cppsrc/js-wrappers/wrapBlit.o] Error 1
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: make failed with exit code: 2

Add support for `loadFont`

Sorry if I'm missing something, but it's my understanding that loadFont is not part of the jimp-native library. I've noticed that bitmap font loading is very slow in jimp, and it looks like even if you try to run a bunch of font loading concurrently, they all get stuck in a queue anyway and the situation doesn't improve.

I think we'd see huge gains by implementing the font loading natively (and in parallel!) and this would eliminate a huge bottleneck in terms of speed.

Use matrix rotation when rotating by a multiple of 90 degrees

Jimp has recently merged a change to the rotate algorithm where rotating by 90 degrees uses a more optimal matrix rotation algorithm. (jimp-dev/jimp#1209) This is causing one of our tests to fail. We should implement this shortcut as well as rotating a matrix is a lot easier than actually doing the math on where a pixel should be relocated to.

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.