New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

jimp-roundcorners

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jimp-roundcorners

Rounds the corners of a Jimp image.

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

jimp-roundedcorners

Rounds the corners of a Jimp image.

Install

npm i jimp-roundedcorners

Usage

import Jimp from 'jimp'
import { roundCornersFromPath, roundCorners } from 'jimp-roundcorners'

roundCornersFromPath('inPath', {
    outImgPath: 'outPath',
    cornerRadius: {
        topLeft: 25,
        topRight: 25,
        // bottomRight: 25,
        bottomLeft: 25,
        // If any of the above is not provided,
        // 'global' will be used instead
        // In this case 'bottomRight'.
        // If global is not prvided, the default value is
        // Math.min(img.bitmap.width, img.bitmap.height) / 10
        global: 50
    }
})
.then(res => { console.log(res.img, res.path) })
.catch(err => console.log(err))

Jimp.read('inPath')
.then(img => {
    roundCorners(img, {
        cornerRadius: {
            topLeft: 25,
            topRight: 25,
            // bottomRight: 25,
            bottomLeft: 25,
// If any of the above is not provided, 'global' will be used instead
// In this case 'bottomRight'.
// If global is not prvided, the default value is
// Math.min(img.bitmap.width, img.bitmap.height) / 10
            global: 50
        }
    }).write('outPath')
})
.catch(err => console.log(err))

FAQs

Package last updated on 27 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts