JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q35336F
  • License MIT

An embeed java image processor to crop and create resized images.

Package Exports

  • img-jar

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (img-jar) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

img-jar

An embeed java image processor to crop and create resized images.

Installation

$ npm install --save img-jar

Usage

var imgJar = require('img-jar');
var path = require('path');

function callback(error, stdout, stderr){ 
    if(error || stderr){
        console.error('Erro:\n' + error || stderr);
    }else{
        console.log(stdout);
    }
};

// Crop only
imgJar(__dirname + '\\finding-dory-xlarge.jpg', // origin
    __dirname + '\\dory', // destination
    {x : 180, y : 150, h : 300, w : 350}, // crop parameters
    callback); //callback
        
// Crop and resizes
imgJar(__dirname + '\\finding-dory-xlarge.jpg', // origin
    __dirname + '\\dory', // destination
    {x : 180, y : 150, h : 300, w : 350}, // crop parameters
    {small : 100, // resize the dory image to 100 pixels max (dory-small.jpg)
      thumb : 150, // resize the dory image to 150 pixels max (dory-thumb.jpg)
      half: 0.5}, // resize the dory image to half (dory-half.jpg)
    callback); //callback

Contact-me

License

MIT