nanojpeg

0.0.3 • Public • Published

JavaScript JPEG Parser

This is a port of Martin Fiedler's NanoJPEG library from C to Skew. It supports both grayscale and RGB JPEGs but doesn't support progressive or CMYK JPEGs. I've also added automatic EXIF orientation correction. For development, first install the compiler using npm install, then invoke the compiler using npm run build.

Usage:

var encoded; // Input: a JPEG file as a Uint8Array
var decoded = decodeJPEG(encoded); // Or "require('nanojpeg').decodeJPEG(encoded);" for node
if (decoded !== null) {
  console.log('width', decoded.width);
  console.log('height', decoded.height);
  console.log('rgb', decoded.rgb);
}

Readme

Keywords

none

Package Sidebar

Install

npm i nanojpeg

Weekly Downloads

3

Version

0.0.3

License

none

Unpacked Size

47.3 kB

Total Files

6

Last publish

Collaborators

  • evanw