{"id":18552385,"url":"https://github.com/traviswimer/grunt-resize-crop","last_synced_at":"2025-04-09T22:31:51.653Z","repository":{"id":15203441,"uuid":"17931753","full_name":"traviswimer/grunt-resize-crop","owner":"traviswimer","description":"Grunt Plugin --- Make images a specific size without distorting the aspect ratio. Resizes as close as possible and crops the rest.","archived":false,"fork":false,"pushed_at":"2016-02-21T06:37:28.000Z","size":128,"stargazers_count":2,"open_issues_count":2,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-25T13:00:56.148Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/traviswimer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-20T05:28:57.000Z","updated_at":"2015-06-09T14:03:02.000Z","dependencies_parsed_at":"2022-09-10T14:01:59.800Z","dependency_job_id":null,"html_url":"https://github.com/traviswimer/grunt-resize-crop","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traviswimer%2Fgrunt-resize-crop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traviswimer%2Fgrunt-resize-crop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traviswimer%2Fgrunt-resize-crop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traviswimer%2Fgrunt-resize-crop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/traviswimer","download_url":"https://codeload.github.com/traviswimer/grunt-resize-crop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248123726,"owners_count":21051520,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T21:14:05.093Z","updated_at":"2025-04-09T22:31:51.219Z","avatar_url":"https://github.com/traviswimer.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# grunt-resize-crop [![Build Status](https://travis-ci.org/traviswimer/grunt-resize-crop.png?branch=master)](https://travis-ci.org/traviswimer/grunt-resize-crop)\n\n\u003e Make images a specific size without distorting the aspect ratio. Resizes as close as possible and crops the rest.\n\n_This plugin is a wrapper for [resize-crop](https://github.com/traviswimer/resize-crop.js)_\n\n## Getting Started\nThis plugin requires [Grunt](http://gruntjs.com/) `~0.4.4` -- [Learn to use Grunt](http://gruntjs.com/getting-started)\n\nInstall the plugin with this command:\n\n```shell\nnpm install grunt-resize-crop --save-dev\n```\n\nEnable in your Gruntfile with:\n\n```js\ngrunt.loadNpmTasks('grunt-resize-crop');\n```\n\n\n## The \"resize_crop\" task\n\nIn your project's Gruntfile, add a section named `resize_crop` to the data object passed into `grunt.initConfig()`.\n\n```js\ngrunt.initConfig({\n  resize_crop: {\n    image_group: {\n      options: {\n        format: \"jpg\",\n        gravity: \"center\",\n        height: 200,\n        width: 200\n      },\n      files: {\n        'your/destination/directory': [\n          'your/source/images/kittens.png',\n          'your/source/images/puppies.jpg'\n        ],\n      },\n    },\n    other_images: {\n      options: {\n        height: 400,\n        width: 400\n      },\n      files: {\n        'your/other/destination/directory': [\n          'your/source/images/image.png'\n        ],\n      },\n    },\n  },\n});\n```\n\n## Options\n\n### options.height\n\n* REQUIRED OPTION\n* Type: `integer`\n* Description: Sets the height in pixels to be used for the output image.\n\n### options.width\n\n* REQUIRED OPTION\n* Type: `integer`\n* Description: Sets the width in pixels to be used for the output image.\n\n### options.format\n\n* Type: `String`\n* Default: `\"png\"`\n* Description: Sets the image type to output. Supporst any image format supported by [imagemagick](https://github.com/rsms/node-imagemagick)\n\n### options.gravity\n\n* Type: `string`\n* Description: Determines the part of the image that will be removed during cropping. For example, `\"center\"` will try to keep the centermost part of the image and only remove the furthest edges.\n\n## Files\n\nFollows the format of:\n```javascript\n{\n  \"an output directory\": ['image1', 'image2', 'image3']\n}\n```\n\n## Contributing\nIn 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](http://gruntjs.com/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftraviswimer%2Fgrunt-resize-crop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftraviswimer%2Fgrunt-resize-crop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftraviswimer%2Fgrunt-resize-crop/lists"}