1.0.1 • Published 5 years ago

node-social-image-resizer v1.0.1

Weekly downloads
2
License
MIT
Repository
-
Last release
5 years ago

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 image
  • socialPlatformType 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)

  • backgroundColorrgba hex: (default is 0x00000000)