node-social-image-resizer
v1.0.1
Published
Resize images to fit multiple social platforms
Downloads
3
Readme
node-social-image-resizer
Resize images to fit multiple social platforms Built on top of jimp
Getting started
To use it in node.js
first install by:
npm install node-social-image-resizer --save
Then import it:
const socialResize = require('node-social-image-resizer');
Usage
Example
socialResize('./path/to/original.jpg','facebookProfile','./path/to/resized.jpg',0xFFFFFFFF)
.then(
res => console.log(res)
//./path/to/resized.jpg
)
.catch( err => console.log(err));
parameters
socialResize(srcImgPath, socialPlatformType, destImgPath = srcImgPath, backgroundColor= 0x00000000)
srcImgPath
: The path of the original imagesocialPlatformType
The platform type, types available: 'facebookProfile' 'facebookCover' 'twitterProfile' 'twitterHeader' 'instagramProfile' 'instagramPost' 'linkedinProfile' 'linkedinCover' 'pinterestProfile' 'youtubeProfile' 'youtubeCover' 'tumblrProfile'destImgPath
[String]: Destination image path (default = source image path)backgroundColor
[rgba hex]: (default is 0x00000000)