Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@jimp/plugin-rotate
Advanced tools
@jimp/plugin-rotate is a plugin for the Jimp image processing library that provides functionality to rotate images. It allows users to rotate images by a specified number of degrees, either clockwise or counterclockwise.
Rotate Image
This feature allows you to rotate an image by a specified number of degrees. In this example, the image is rotated by 90 degrees and then saved to a new file.
const Jimp = require('jimp');
Jimp.read('path/to/image.jpg')
.then(image => {
return image.rotate(90) // rotate image by 90 degrees
.write('path/to/rotated-image.jpg'); // save
})
.catch(err => {
console.error(err);
});
Rotate Image with Background Color
This feature allows you to rotate an image by a specified number of degrees and fill the background with a specified color. In this example, the image is rotated by 45 degrees with a white background.
const Jimp = require('jimp');
Jimp.read('path/to/image.jpg')
.then(image => {
return image.rotate(45, false, 0xFFFFFFFF) // rotate image by 45 degrees with white background
.write('path/to/rotated-image.jpg'); // save
})
.catch(err => {
console.error(err);
});
Sharp is a high-performance image processing library that supports a wide range of image transformations, including rotation. It is known for its speed and efficiency, making it a popular choice for server-side image processing. Compared to @jimp/plugin-rotate, Sharp offers more advanced features and better performance.
GraphicsMagick (gm) is a powerful image processing library that provides a wide range of image manipulation capabilities, including rotation. It is a wrapper for the GraphicsMagick and ImageMagick tools, which are well-known for their robustness and versatility. Compared to @jimp/plugin-rotate, gm offers more comprehensive image processing functionalities.
lwip is a lightweight image processing library that supports basic image transformations, including rotation. It is designed to be simple and easy to use, making it suitable for small-scale image processing tasks. Compared to @jimp/plugin-rotate, lwip is more lightweight but may lack some of the advanced features offered by Jimp.
Rotate an image.
Rotates the image counter-clockwise by a number of degrees. By default the width and height of the image will be resized appropriately.
FAQs
Unknown package
The npm package @jimp/plugin-rotate receives a total of 970,016 weekly downloads. As such, @jimp/plugin-rotate popularity was classified as popular.
We found that @jimp/plugin-rotate 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.