node-jpeg-turbo provides minimal libjpeg-turbo bindings for Node.js. It is very, very fast compared to other alternatives, such as node-imagemagick-native or jpeg-js.
Currently the focus is on decompressing images as quickly as possible.
We use NAN to guarantee maximum v8 API compatibility, so in theory any Node.js or io.js version should work fine. For maximum convenience we also use node-pre-gyp to publish prebuilt binaries for a few common platforms. For example, if you're on OS X and using the latest stable Node, you probably won't need to do a thing.
Due to massive linking pain on Ubuntu, we embed and build libjpeg-turbo
directly with node-gyp
. Unfortunately this adds an extra requirement, as the build process needs yasm
to enable all optimizations. Note that this step is only required for x86
and x86_64
architectures. You don't need yasm
if you're building on arm
, for example.
Here's how to install yasm
:
On OS X
brew install yasm
On Ubuntu 14.04
apt-get install yasm
On Ubuntu 12.04
apt-get install yasm
Important! Ubuntu 12.04 comes with GCC 4.6, which is too old to compile the add-on (and most other modules since Node.js 4.0 was released). More information is available here.
If you really must use this module on Ubuntu 12.04, the following may work:
apt-get install python-software-properties
add-apt-repository -y ppa:ubuntu-toolchain-r/test
apt-get -y install g++-4.8
export CXX=g++-4.8
Remember to export CXX
when you npm install
.
On Debian
apt-get install yasm
On Alpine Linux
apk add yasm
Others
Search your package manager for yasm
.
Make sure you've got the requirements installed. Then simply install from NPM:
npm install --save jpeg-turbo
- https://github.com/A2K/node-jpeg-turbo-scaler
- https://github.com/mash/node-imagemagick-native
- https://github.com/google/skia/blob/master/gyp/libjpeg-turbo.gyp
- https://github.com/openstf/android-libjpeg-turbo
See LICENSE.
Copyright © Simo Kinnunen. All Rights Reserved.