Package Exports
- circle-image
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 (circle-image) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Circle-Image
Github
Pull request and issues tracked here: https://github.com/eenewbsauce/circle-image
NPM
Official home on NPM: https://www.npmjs.com/package/circle-image
circle-image is based on ImageMagick. You can install it one of the following ways:
On Ubuntu
$ apt-get install ImageMagick
On Mac OS X
$ brew install ImageMagick
On CentOS
$ yum install ImageMagick
Installation
npm install circle-image --save
Usage
the image (imagepath) needs to be square and dimensions need to be larger than the biggest size specified in imageSizes below.
var images = require('circle-image');
var imageSizes = [125, 100, 30];
//uniqueId param is used to identify a user
//so use the primary key or something guaranteed to be unique
images.execute('imagepath', uniqueId, imageSizes).then(function (paths) {
//array of circularized image paths
console.log(paths[0]); //circle_user_{uniqueId}_150.png
})