{"_id":"@benchesh/grunt-image-resize","_rev":"1-9893c4586de3d96cf47a32677516e3cd","name":"@benchesh/grunt-image-resize","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@benchesh/grunt-image-resize","description":"Resizing images made easy.","version":"1.0.0","homepage":"https://github.com/excellenteasy/grunt-image-resize","author":{"name":"David Pfahler","email":"david@excellenteasy.com","url":"http://excellenteasy.com"},"repository":{"type":"git","url":"git://github.com/excellenteasy/grunt-image-resize.git"},"bugs":{"url":"https://github.com/excellenteasy/grunt-image-resize/issues"},"licenses":[{"type":"MIT","url":"https://github.com/excellenteasy/grunt-image-resize/blob/master/LICENSE"}],"main":"Gruntfile.js","engines":{"node":">= 0.8.0"},"scripts":{"test":"grunt test","before-deploy":"grunt before-deploy","after-deploy":"grunt after-deploy"},"devDependencies":{"grunt":"^0.4.5","grunt-cli":"^0.1.13","grunt-contrib-clean":"^0.6.0","grunt-contrib-jshint":"^0.10.0","grunt-contrib-nodeunit":"^0.4.1","grunt-semantic-release":"^0.2.1","load-grunt-tasks":"^2.0.0"},"keywords":["gruntplugin"],"dependencies":{"async":"^0.9.0","gm":"^1.14.2"},"gitHead":"e7d9e9604b18590d760d9276599cc51747aadcb1","_id":"@benchesh/grunt-image-resize@1.0.0","_nodeVersion":"10.15.1","_npmVersion":"6.10.2","dist":{"integrity":"sha512-12murAFKtYv9WEWwWr5/Yblwi+b7m2l8tdR6o5hSwQLdUNeyv4eM6Dovc0XnceJ6owmq11Cw63t5kRrFEJlw7w==","shasum":"8e056f7722ca764a5723df6be852632e3ce00f50","tarball":"https://registry.npmjs.org/@benchesh/grunt-image-resize/-/grunt-image-resize-1.0.0.tgz","fileCount":40,"unpackedSize":2274929,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdjS+nCRA9TVsSAnZWagAA4m8P/3KqNEtueY5dXqkDOvCD\ncdLYrd1yOj94T/Np8URpVdb5ydrqD/sHYXAapggibP6xVmcusPTwdBMiEUYS\nZt9hFmlKXD/ajZQSdI4WpNLEeiUNmlVdDN+yyEO5T9qEwgb8d2stB6xeOOm4\ne4X5o+pm/zdpkJGCeDiSqmoAOW1zLS2z6uDfOM0vKtLqFy4bQIrNpfi8R0Ic\ny4V+y1FfVKoQsi3lp27Q1aw4AKNBf3LTt8cEcXn97B6o+z28afIIHtYlvRDp\nOY+oykIodTSeoe984Pq9dP2MtpB/EeFJTNG3VIBIr75jASakAi8XZ4KvU28/\nomk28gfZvWlFraLmO9DhOGI8gpX13PtdXRuHTKwXgBCllRCbVHB6/6JsJMWj\ne0aCWswO87m2tFc9Fvohy+ljfl2Gmlcmt9UaJ6hQ1pUZCrI8l32MiCT7onbd\n4QY65OIC0pOBxmoS1NXnXvOmmQCm+eGKJI4ESobX3MHD5IVUDb7f+9+wCHv4\no4q7SL2/jRSZseRPva85Jioc7H6Zh8IGUfQPIrL2BN3hYs60tLPmo0V5m1zN\nvp3i0gxs0ZRXOhh55zMDHIx8kolqMZ2v/WpNLV83eMeUTJNk4SncvuUCtky1\nB7fqOMVCLu1Q9uF5XcQ9CceB4/T/vqwha/liOyi14APupZbeaVDBv/50bGPA\ns5/N\r\n=x32Z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICtNb/zwlX+5e7fpUj1XYbT1sMILgV/pZCbjXHGf8BZ6AiEA/WRW7Nga5NuG5NeeQp+u1nosI9z2CBhZRhAbrPzVR5w="}]},"maintainers":[{"name":"benchesh","email":"b.j.cheshire@gmail.com"}],"_npmUser":{"name":"benchesh","email":"b.j.cheshire@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/grunt-image-resize_1.0.0_1569533862632_0.5859506024608412"},"_hasShrinkwrap":false}},"time":{"created":"2019-09-26T21:37:42.404Z","1.0.0":"2019-09-26T21:37:42.895Z","modified":"2022-04-04T18:21:57.117Z"},"maintainers":[{"name":"benchesh","email":"b.j.cheshire@gmail.com"}],"description":"Resizing images made easy.","homepage":"https://github.com/excellenteasy/grunt-image-resize","keywords":["gruntplugin"],"repository":{"type":"git","url":"git://github.com/excellenteasy/grunt-image-resize.git"},"author":{"name":"David Pfahler","email":"david@excellenteasy.com","url":"http://excellenteasy.com"},"bugs":{"url":"https://github.com/excellenteasy/grunt-image-resize/issues"},"readme":"# grunt-image-resize\n\n[![Build Status](https://travis-ci.org/excellenteasy/grunt-image-resize.svg)](https://travis-ci.org/excellenteasy/grunt-image-resize)\n[![Dependency Status](https://david-dm.org/excellenteasy/grunt-image-resize.svg)](https://david-dm.org/excellenteasy/grunt-image-resize)\n[![devDependency Status](https://david-dm.org/excellenteasy/grunt-image-resize/dev-status.svg)](https://david-dm.org/excellenteasy/grunt-image-resize#info=devDependencies)\n\n> Resizing images made easy - thanks to ImageMagick.\n\n## Getting Started\nThis plugin requires Grunt `^0.4.5` and ImageMagick.\n\n### Grunt\nIf you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:\n\n```shell\nnpm install grunt-image-resize --save-dev\n```\n\nOne the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:\n\n```js\ngrunt.loadNpmTasks('grunt-image-resize');\n```\n\n### ImageMagick\nMake sure ImageMagick is installed on your system and properly set up in your `PATH`.\n\nUbuntu:\n\n```shell\n$ apt-get install imagemagick\n```\n\nMac OS X (using [Homebrew](http://brew.sh/)):\n\n```shell\n$ brew install imagemagick\n```\n\nWindows & others: \n\n[http://www.imagemagick.org/script/binary-releases.php](http://www.imagemagick.org/script/binary-releases.php)\n\nConfirm that ImageMagick is properly set up by executing `convert -help` in a terminal.\n\n## The \"image_resize\" task\n\n### Overview\nIn your project's Gruntfile, add a section named `image_resize` to the data object passed into `grunt.initConfig()`.\n\n```js\ngrunt.initConfig({\n  image_resize: {\n    options: {\n      width: 100,\n      height: 100,\n      overwrite: true\n    },\n    your_target: {\n      // Target-specific file lists and/or options go here.\n    },\n  },\n})\n```\n\n### Options\n\n#### options.width\nType: `Number`\n\nA number value that is passed as pixel or percentage value to imagemagick. If not defined, the resized image will keep the aspect ratio.\n\n#### options.height\nType: `Number`\n\nA number value that is passed as pixel or percentage value to imagemagick. If not defined, the resized image will keep the aspect ratio.\n\n#### options.overwrite\nType: `Boolean`\nDefault value: `true`\n\nDetermines whether file that already exist under this destination will be overwritten.\n\n#### options.upscale\nType: `Boolean`\nDefault value: `false`\n\nDetermines whether images will be upscaled. If set to `false` (default), image will be copied instead of resized if it would be upscaled by resizing.\n\n#### options.crop\nType: `Boolean`\nDefault value: `false`\n\nDetermines whether images will be cropped after resizing to exactly match `options.width` and `options.height`.\n\n#### options.gravity\nType: `String`\nDefault value: `Center`\nPossible values: `NorthWest`, `North`, `NorthEast`, `West`, `Center`, `East`, `SouthWest`, `South`, `SouthEast`\n\nWhen cropping images this sets the image gravity. Doesn't have any effect, if `options.crop` is `false`.\n\n#### options.concurrency\nType: `Number`\nDefault value: Number of CPUs\n\nDetermines how many resize operations are executed in parallel.\n\n#### options.quality\nType: `Number`\nDefault value: `1`\n\nDetermines the output quality of the resized image. Ranges from `0` (really bad) to `1` (almost lossless). Only applies to jpg images.\n\n#### options.autoOrient\nType: `Boolean`\nDefault value: `false`\n\nDetermines if resized image will be rotated according to EXIF information. Only applies to jpg images.\n\n### Usage Examples\n\n#### Default Options\nIn this example, the default options are used to resize an image to 100px width. So if the `test/fixtures/wikipedia.png` file has a width of 500px, the generated result would be a 100px wide `tmp/wikipedia.png`.\n\n```js\ngrunt.initConfig({\n  image_resize: {\n    resize: {\n      options: {\n        width: 100\n      },\n      files: {\n        'tmp/wikipedia.png': 'test/fixtures/wikipedia.png'\n      }\n    }\n  }\n})\n```\n\n#### Prevent overwriting\nIn this example, we prevent the destination file from being overwritten if it already exists. It the file `tmp/wikipedia.png` already exists, for example because we just ran the task configuration above, this would **not** overwrite `tmp/wikipedia.png`. The file `tmp/wikipedia.png` would still be 100px wide.\n\n```js\ngrunt.initConfig({\n  image_resize: {\n    no_overwrite: {\n      options: {\n        width: 50,\n        overwrite: false\n      },\n      files: {\n        'tmp/wikipedia.png': 'test/fixtures/wikipedia.png'\n      }\n    }\n  }\n})\n```\n\n#### Allow upscaling\nBy default, the task does not resize images which would be upscaled. It only allows downscaling. You can allow upscaling by setting the `upscale` option to `true`. Otherwise images will copied instead of resized when they would be upscaled by resizing.\n\n```js\ngrunt.initConfig({\n  image_resize: {\n    no_overwrite: {\n      options: {\n        width: 600,\n        upscale: true\n      },\n      files: {\n        'tmp/wikipedia.png': 'test/fixtures/wikipedia.png'\n      }\n    }\n  }\n})\n```\n\n#### Resize all the images in a directory\n\n```js\ngrunt.initConfig({\n  image_resize: {\n    resize: {\n      options: {\n        width: 100,\n      },\n      src: 'src/*.JPG',\n      dest: 'dest/'\n    }\n  }\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","readmeFilename":"README.md"}