
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
grunt-resize-crop
Advanced tools
Make images a specific size without distorting the aspect ratio. Resizes as close as possible and crops the rest.
Make images a specific size without distorting the aspect ratio. Resizes as close as possible and crops the rest.
This plugin is a wrapper for resize-crop
This plugin requires Grunt ~0.4.4
-- Learn to use Grunt
Install the plugin with this command:
npm install grunt-resize-crop --save-dev
Enable in your Gruntfile with:
grunt.loadNpmTasks('grunt-resize-crop');
In your project's Gruntfile, add a section named resize_crop
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
resize_crop: {
image_group: {
options: {
format: "jpg",
gravity: "center",
height: 200,
width: 200
},
files: {
'your/destination/directory': [
'your/source/images/kittens.png',
'your/source/images/puppies.jpg'
],
},
},
other_images: {
options: {
height: 400,
width: 400
},
files: {
'your/other/destination/directory': [
'your/source/images/image.png'
],
},
},
},
});
integer
integer
String
"png"
string
"center"
will try to keep the centermost part of the image and only remove the furthest edges.Follows the format of:
{
"an output directory": ['image1', 'image2', 'image3']
}
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
FAQs
Make images a specific size without distorting the aspect ratio. Resizes as close as possible and crops the rest.
We found that grunt-resize-crop demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.