Socket
Socket
Sign inDemoInstall

@jimp/core

Package Overview
Dependencies
30
Maintainers
2
Versions
220
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jimp/core

Jimp core


Version published
Maintainers
2
Weekly downloads
1,118,944
increased by1.86%
Install size
3.56 MB

Weekly downloads

Readme

Source

@jimp/core

The main Jimp class. This class can be extended with types and bitmap manipulation functions. Out of the box it does not support any image type.

Available Methods

Jimp

The Jimp class constructor.

addConstants

Add constant or static methods to the Jimp constructor.

addConstants({
  MIME_SPECIAL: "image/special",
});

addJimpMethods

Add a bitmap manipulation method to Jimp constructor. These method should return this so that the function can be chain-able.

addJimpMethods({
  cropCrazy: function() {
    // Your custom image manipulation method

    return this;
  }
})

const image = await Jimp.read(...);

image.resize(10, Jimp.AUTO),
  .cropCrazy();

await image.writeAsync('test.png');

addType

Add a image mime type to Jimp constructor. First argument is a mime type and the second is an array of file extension for that type.

addType("image/special", ["spec", "special"]);

FAQs

Last updated on 23 Feb 2024

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc