Security News
Combatting Alert Fatigue by Prioritizing Malicious Intent
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
@jimp/plugin-cover
Advanced tools
Scale the image so the given width and height keeping the aspect ratio. Some parts of the image may be clipped.
import jimp from 'jimp';
async function main() {
const image = await jimp.read('test/image.png');
image.cover(150, 100);
}
main();
The following constants can be passed to image.cover
:
Jimp.HORIZONTAL_ALIGN_LEFT;
Jimp.HORIZONTAL_ALIGN_CENTER;
Jimp.HORIZONTAL_ALIGN_RIGHT;
Jimp.VERTICAL_ALIGN_TOP;
Jimp.VERTICAL_ALIGN_MIDDLE;
Jimp.VERTICAL_ALIGN_BOTTOM;
For example:
image.cover(250, 250, Jimp.HORIZONTAL_ALIGN_LEFT | Jimp.VERTICAL_ALIGN_TOP);
image.cover(250, 250, Jimp.HORIZONTAL_ALIGN_RIGHT | Jimp.VERTICAL_ALIGN_BOTTOM);
Default align mode for image.cover
is:
Jimp.HORIZONTAL_ALIGN_CENTER | Jimp.VERTICAL_ALIGN_MIDDLE;
v0.8.1 (Thu Sep 12 2019)
@jimp/cli
, @jimp/core
, @jimp/custom
, jimp
, @jimp/plugin-blit
, @jimp/plugin-blur
, @jimp/plugin-color
, @jimp/plugin-contain
, @jimp/plugin-cover
, @jimp/plugin-displace
, @jimp/plugin-dither
, @jimp/plugin-flip
, @jimp/plugin-gaussian
, @jimp/plugin-invert
, @jimp/plugin-mask
, @jimp/plugin-normalize
, @jimp/plugin-rotate
, @jimp/plugin-scale
, @jimp/plugin-threshold
, @jimp/plugins
, @jimp/utils
FAQs
Unknown package
The npm package @jimp/plugin-cover receives a total of 1,125,101 weekly downloads. As such, @jimp/plugin-cover popularity was classified as popular.
We found that @jimp/plugin-cover demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
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.
Security News
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.