From 14305d9563ad98dfd2b4524f3f816767de56849a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20David=20S=C3=A1nchez=20Suero?= Date: Fri, 18 Aug 2017 00:39:59 -0400 Subject: [PATCH 1/2] Fix format errors Empty code blocks not rendering, and some missing code block start/end tags --- README.md | 188 +++++++++++++++++++++++++++--------------------------- 1 file changed, 94 insertions(+), 94 deletions(-) diff --git a/README.md b/README.md index b6af3f4..1a99fc3 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,7 @@ of cpu cores. An array of objects containing the sizes and settings we want to resize our image to. For example: - ```js +```js sizes: [{ name: "small", width: 480 @@ -117,117 +117,117 @@ sizes: [{ }] ``` - The settings available are as follows: - - * **width**
- *Type:* `Number` or `String`
- *Version:* 0.0.1 and above +The settings available are as follows: - `width` can either be in pixels or percentages. Please note both width and height need to use the same units, so if width is a percentage value and you wish to specify a height this must also be a percentage. +* **width**
+ *Type:* `Number` or `String`
+ *Version:* 0.0.1 and above - The following values are examples of valid widths: `1`, `'1px'`, `'1'`, `'1%'`, `'1.1%'`, `'11.11111%'`, `'111111%'`
- The following values are examples of invalid values for width: `-1`, `1.1`, `1.1px`, `'1.1.1%'`, `'1a'`, `'a1'` + `width` can either be in pixels or percentages. Please note both width and height need to use the same units, so if width is a percentage value and you wish to specify a height this must also be a percentage. - * **height**
- *Type:* `Number` or `String`
- *Version:* 0.0.1 and above + The following values are examples of valid widths: `1`, `'1px'`, `'1'`, `'1%'`, `'1.1%'`, `'11.11111%'`, `'111111%'`
+ The following values are examples of invalid values for width: `-1`, `1.1`, `1.1px`, `'1.1.1%'`, `'1a'`, `'a1'` - `height` can either be in pixels or percentages. Please note both width and height need to use the same units, so if height is a percentage value and you wish to specify a width this must also be a percentage.
- `height` accepts the same values as width. +* **height**
+ *Type:* `Number` or `String`
+ *Version:* 0.0.1 and above - * **name**
- *Type:* `String`
- *Default:* none
- *Version:* 0.0.1 and above + `height` can either be in pixels or percentages. Please note both width and height need to use the same units, so if height is a percentage value and you wish to specify a width this must also be a percentage.
+ `height` accepts the same values as width. - If a `name` is specified, then the file will be suffixed with this name. e.g. `my-image-small.jpg`
- If a `name` is not specified, then the file will be suffixed with the width and/or height specified in the size options. e.g. `my-image-320x240.jpg` +* **name**
+ *Type:* `String`
+ *Default:* none
+ *Version:* 0.0.1 and above - * **rename**
- *Type:* `Boolean`
- *Default:* `true`
- *Version:* 0.1.3 and above + If a `name` is specified, then the file will be suffixed with this name. e.g. `my-image-small.jpg`
+ If a `name` is not specified, then the file will be suffixed with the width and/or height specified in the size options. e.g. `my-image-320x240.jpg` - If `rename` is set to `false`, then at this size the file will not be renamed, but will instead keep its original name. Suffixes will still be applied. +* **rename**
+ *Type:* `Boolean`
+ *Default:* `true`
+ *Version:* 0.1.3 and above - * **quality**
- *Type:* `Number`
- *Default:* `100`
- *Available Values:* `1` - `100`
- *Version:* 0.0.4 and above + If `rename` is set to `false`, then at this size the file will not be renamed, but will instead keep its original name. Suffixes will still be applied. - JPEG format only. The quality of the image, 100 being the highest quality and 1 being the lowest. +* **quality**
+ *Type:* `Number`
+ *Default:* `100`
+ *Available Values:* `1` - `100`
+ *Version:* 0.0.4 and above - Please note: In versions below 0.1.0, quality is specified between 0 and 1. + JPEG format only. The quality of the image, 100 being the highest quality and 1 being the lowest. - * **suffix**
- *Type:* `String`
- *Default:* none
- *Version:* 0.0.1 and above + Please note: In versions below 0.1.0, quality is specified between 0 and 1. - Use `suffix` for retina graphic filenames. e.g. `my-image-320x240_x2.jpg` +* **suffix**
+ *Type:* `String`
+ *Default:* none
+ *Version:* 0.0.1 and above - * **aspectRatio**
- *Type:* `Boolean`
- *Default:* `true`
- *Available Values:* `true` || `false`
- *Version:* 0.1.0 and above + Use `suffix` for retina graphic filenames. e.g. `my-image-320x240_x2.jpg` - Maintains the aspect ratio of the image. The width and the height are treated as maximum values, - so the image is expanded or contracted to fit the width and height value while maintaining the aspect ratio of the image. - If `aspectRatio` is set to `false` and both width and height are specified, the image will be cropped. +* **aspectRatio**
+ *Type:* `Boolean`
+ *Default:* `true`
+ *Available Values:* `true` || `false`
+ *Version:* 0.1.0 and above - * **gravity**
- *Type:* `String`
- *Default:* `Center`
- *Available Values:* `NorthWest` || `North` || `NorthEast` || `West` || `Center` || `East` || `SouthWest` || `South` || `SouthEast`
- *Version:* 0.1.0 and above + Maintains the aspect ratio of the image. The width and the height are treated as maximum values, + so the image is expanded or contracted to fit the width and height value while maintaining the aspect ratio of the image. + If `aspectRatio` is set to `false` and both width and height are specified, the image will be cropped. - `gravity` determines the placement of the image within the crop. The default is `Center`. - This setting only applies if an image is cropped. Cropping occurs when the aspectRatio is set to `false` and both width and height are specified. +* **gravity**
+ *Type:* `String`
+ *Default:* `Center`
+ *Available Values:* `NorthWest` || `North` || `NorthEast` || `West` || `Center` || `East` || `SouthWest` || `South` || `SouthEast`
+ *Version:* 0.1.0 and above - * **upscale**
- *Type:* `Boolean`
- *Default:* `false`
- *Available Values:* `true` || `false`
- *Version:* 0.1.0 and above. + `gravity` determines the placement of the image within the crop. The default is `Center`. + This setting only applies if an image is cropped. Cropping occurs when the aspectRatio is set to `false` and both width and height are specified. - If the requested size is larger than the source image should the image be upscaled? +* **upscale**
+ *Type:* `Boolean`
+ *Default:* `false`
+ *Available Values:* `true` || `false`
+ *Version:* 0.1.0 and above. - * **sharpen**
- *Type:* `Object`
- *Default:* `null`
- *Version:* 0.1.7 and above + If the requested size is larger than the source image should the image be upscaled? - Sharpen allows you to pass an object with 'sigma' and 'radius' options. The most important factor is the sigma. As it is the real control of the sharpening operation. Sigma can be any floating point value from .1 for practically no sharpening to 3 or more for sever sharpening. 0.5 to 1.0 work well. Radius is the limit of the effect as is the threshold. Radius is only in integer units as that is the way the algorithm works, the larger it is the slower it is. But it should be at a minimum 1 or better still 2 times the sigma. For example: +* **sharpen**
+ *Type:* `Object`
+ *Default:* `null`
+ *Version:* 0.1.7 and above + Sharpen allows you to pass an object with 'sigma' and 'radius' options. The most important factor is the sigma. As it is the real control of the sharpening operation. Sigma can be any floating point value from .1 for practically no sharpening to 3 or more for sever sharpening. 0.5 to 1.0 work well. Radius is the limit of the effect as is the threshold. Radius is only in integer units as that is the way the algorithm works, the larger it is the slower it is. But it should be at a minimum 1 or better still 2 times the sigma. For example: +```js sharpen: { sigma: 1, radius: 2 } +``` +* **filter**
+ *Type:* `String`
+ *Default:* Either `Mitchell` if the image is being enlarged, or supports a palette or matte channel. Otherwise `Lanczos.`
+ *Available Values:* `Point` || `Box` || `Triangle` || `Hermite` || `Hanning` || `Hamming` || `Blackman` || `Gaussian` || `Quadratic` || `Cubic` || `Catrom` || `Mitchell` || `Lanczos` || `Bessel` || `Sinc`
+ *Version:* 0.1.1 and above. - * **filter**
- *Type:* `String`
- *Default:* Either `Mitchell` if the image is being enlarged, or supports a palette or matte channel. Otherwise `Lanczos.`
- *Available Values:* `Point` || `Box` || `Triangle` || `Hermite` || `Hanning` || `Hamming` || `Blackman` || `Gaussian` || `Quadratic` || `Cubic` || `Catrom` || `Mitchell` || `Lanczos` || `Bessel` || `Sinc`
- *Version:* 0.1.1 and above. - - `filter` effects the resizing operation of an image. Use `Point` for pixel art. [Read more about filters in the ImageMagick documentation](http://www.imagemagick.org/Usage/filter/). + `filter` effects the resizing operation of an image. Use `Point` for pixel art. [Read more about filters in the ImageMagick documentation](http://www.imagemagick.org/Usage/filter/). - * **sample**
- *Type:* `Boolean`
- *Default:* `false`
- *Available Values:* `true` || `false`
- *Version:* 0.1.6 and above. +* **sample**
+ *Type:* `Boolean`
+ *Default:* `false`
+ *Available Values:* `true` || `false`
+ *Version:* 0.1.6 and above. - Sometimes using 'sample' on PNGs may produce the same output with smaller filesizes, sometimes the output will be worse. Use this option to fine tune your images to use 'sample' instead of 'resize' where it is possible to do so. + Sometimes using 'sample' on PNGs may produce the same output with smaller filesizes, sometimes the output will be worse. Use this option to fine tune your images to use 'sample' instead of 'resize' where it is possible to do so. - * **density**
- *Type:* `Number`
- *Default:* `72`
- *Version:* 0.1.7 and above +* **density**
+ *Type:* `Number`
+ *Default:* `72`
+ *Version:* 0.1.7 and above - `density` effects the output resolution, in dpi, of an image. The default is 72 dpi. + `density` effects the output resolution, in dpi, of an image. The default is 72 dpi. * **options.separator**
*Type:* `String`
@@ -243,22 +243,22 @@ sizes: [{ 'units' contains the strings that should be used to represent the size units in an image 'name' when `name` has not been specified. e.g. `my-image-50pcx50pc.jpg` - * **pixel** - *Type:* `String`
- *Default:* ``
- *Version:* 0.1.0 and above +* **pixel** + *Type:* `String`
+ *Default:* _(empty string)_
+ *Version:* 0.1.0 and above - * **percentage** - *Type:* `String`
- *Default:* `pc`
- *Version:* 0.1.0 and above +* **percentage** + *Type:* `String`
+ *Default:* `pc`
+ *Version:* 0.1.0 and above - Please note `%` cannot be used as a valid character in an image name. + Please note `%` cannot be used as a valid character in an image name. - * **multiply** - *Type:* `String`
- *Default:* `x`
- *Version:* 0.1.0 and above +* **multiply** + *Type:* `String`
+ *Default:* `x`
+ *Version:* 0.1.0 and above * **options.customIn** *Type:* `String`
From 65ebd70160a4645ceb107aa1a7a3a9a665d3d169 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20David=20S=C3=A1nchez=20Suero?= Date: Fri, 18 Aug 2017 01:28:28 -0400 Subject: [PATCH 2/2] Remove identation --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1a99fc3..cac5c32 100644 --- a/README.md +++ b/README.md @@ -201,10 +201,10 @@ The settings available are as follows: Sharpen allows you to pass an object with 'sigma' and 'radius' options. The most important factor is the sigma. As it is the real control of the sharpening operation. Sigma can be any floating point value from .1 for practically no sharpening to 3 or more for sever sharpening. 0.5 to 1.0 work well. Radius is the limit of the effect as is the threshold. Radius is only in integer units as that is the way the algorithm works, the larger it is the slower it is. But it should be at a minimum 1 or better still 2 times the sigma. For example: ```js - sharpen: { - sigma: 1, - radius: 2 - } +sharpen: { + sigma: 1, + radius: 2 +} ``` * **filter**
*Type:* `String`