sharp 0.20.8 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,181 +2,231 @@
2
2
 
3
3
  ## resize
4
4
 
5
- Resize image to `width` x `height`.
6
- By default, the resized image is centre cropped to the exact size specified.
5
+ Resize image to `width`, `height` or `width x height`.
7
6
 
8
- Possible kernels are:
7
+ When both a `width` and `height` are provided, the possible methods by which the image should **fit** these are:
9
8
 
10
- - `nearest`: Use [nearest neighbour interpolation][1].
11
- - `cubic`: Use a [Catmull-Rom spline][2].
12
- - `lanczos2`: Use a [Lanczos kernel][3] with `a=2`.
9
+ - `cover`: Crop to cover both provided dimensions (the default).
10
+ - `contain`: Embed within both provided dimensions.
11
+ - `fill`: Ignore the aspect ratio of the input and stretch to both provided dimensions.
12
+ - `inside`: Preserving aspect ratio, resize the image to be as large as possible while ensuring its dimensions are less than or equal to both those specified.
13
+ - `outside`: Preserving aspect ratio, resize the image to be as small as possible while ensuring its dimensions are greater than or equal to both those specified.
14
+ Some of these values are based on the [object-fit][1] CSS property.
15
+
16
+ When using a `fit` of `cover` or `contain`, the default **position** is `centre`. Other options are:
17
+
18
+ - `sharp.position`: `top`, `right top`, `right`, `right bottom`, `bottom`, `left bottom`, `left`, `left top`.
19
+ - `sharp.gravity`: `north`, `northeast`, `east`, `southeast`, `south`, `southwest`, `west`, `northwest`, `center` or `centre`.
20
+ - `sharp.strategy`: `cover` only, dynamically crop using either the `entropy` or `attention` strategy.
21
+ Some of these values are based on the [object-position][2] CSS property.
22
+
23
+ The experimental strategy-based approach resizes so one dimension is at its target length
24
+ then repeatedly ranks edge regions, discarding the edge with the lowest score based on the selected strategy.
25
+
26
+ - `entropy`: focus on the region with the highest [Shannon entropy][3].
27
+ - `attention`: focus on the region with the highest luminance frequency, colour saturation and presence of skin tones.
28
+
29
+ Possible interpolation kernels are:
30
+
31
+ - `nearest`: Use [nearest neighbour interpolation][4].
32
+ - `cubic`: Use a [Catmull-Rom spline][5].
33
+ - `lanczos2`: Use a [Lanczos kernel][6] with `a=2`.
13
34
  - `lanczos3`: Use a Lanczos kernel with `a=3` (the default).
14
35
 
15
36
  ### Parameters
16
37
 
17
- - `width` **[Number][4]?** pixels wide the resultant image should be. Use `null` or `undefined` to auto-scale the width to match the height.
18
- - `height` **[Number][4]?** pixels high the resultant image should be. Use `null` or `undefined` to auto-scale the height to match the width.
19
- - `options` **[Object][5]?**
20
- - `options.kernel` **[String][6]** the kernel to use for image reduction. (optional, default `'lanczos3'`)
21
- - `options.fastShrinkOnLoad` **[Boolean][7]** take greater advantage of the JPEG and WebP shrink-on-load feature, which can lead to a slight moiré pattern on some images. (optional, default `true`)
38
+ - `width` **[Number][7]?** pixels wide the resultant image should be. Use `null` or `undefined` to auto-scale the width to match the height.
39
+ - `height` **[Number][7]?** pixels high the resultant image should be. Use `null` or `undefined` to auto-scale the height to match the width.
40
+ - `options` **[Object][8]?**
41
+ - `options.width` **[String][9]?** alternative means of specifying `width`. If both are present this take priority.
42
+ - `options.height` **[String][9]?** alternative means of specifying `height`. If both are present this take priority.
43
+ - `options.fit` **[String][9]** how the image should be resized to fit both provided dimensions, one of `cover`, `contain`, `fill`, `inside` or `outside`. (optional, default `'cover'`)
44
+ - `options.position` **[String][9]** position, gravity or strategy to use when `fit` is `cover` or `contain`. (optional, default `'centre'`)
45
+ - `options.background` **([String][9] \| [Object][8])** background colour when using a `fit` of `contain`, parsed by the [color][10] module, defaults to black without transparency. (optional, default `{r:0,g:0,b:0,alpha:1}`)
46
+ - `options.kernel` **[String][9]** the kernel to use for image reduction. (optional, default `'lanczos3'`)
47
+ - `options.withoutEnlargement` **[Boolean][11]** do not enlarge if the width _or_ height are already less than the specified dimensions, equivalent to GraphicsMagick's `>` geometry option. (optional, default `false`)
48
+ - `options.fastShrinkOnLoad` **[Boolean][11]** take greater advantage of the JPEG and WebP shrink-on-load feature, which can lead to a slight moiré pattern on some images. (optional, default `true`)
22
49
 
23
50
  ### Examples
24
51
 
25
52
  ```javascript
26
- sharp(inputBuffer)
53
+ sharp(input)
54
+ .resize({ width: 100 })
55
+ .toBuffer()
56
+ .then(data => {
57
+ // 100 pixels wide, auto-scaled height
58
+ });
59
+ ```
60
+
61
+ ```javascript
62
+ sharp(input)
63
+ .resize({ height: 100 })
64
+ .toBuffer()
65
+ .then(data => {
66
+ // 100 pixels high, auto-scaled width
67
+ });
68
+ ```
69
+
70
+ ```javascript
71
+ sharp(input)
27
72
  .resize(200, 300, {
28
- kernel: sharp.kernel.nearest
73
+ kernel: sharp.kernel.nearest,
74
+ fit: 'contain',
75
+ position: 'right top',
76
+ background: { r: 255, g: 255, b: 255, alpha: 0.5 }
29
77
  })
30
- .background('white')
31
- .embed()
32
- .toFile('output.tiff')
33
- .then(function() {
34
- // output.tiff is a 200 pixels wide and 300 pixels high image
35
- // containing a nearest-neighbour scaled version, embedded on a white canvas,
36
- // of the image data in inputBuffer
78
+ .toFile('output.png')
79
+ .then(() => {
80
+ // output.png is a 200 pixels wide and 300 pixels high image
81
+ // containing a nearest-neighbour scaled version
82
+ // contained within the north-east corner of a semi-transparent white canvas
37
83
  });
38
84
  ```
39
85
 
40
- - Throws **[Error][8]** Invalid parameters
41
-
42
- Returns **Sharp**
86
+ ```javascript
87
+ const transformer = sharp()
88
+ .resize({
89
+ width: 200,
90
+ height: 200,
91
+ fit: sharp.fit.cover,
92
+ position: sharp.strategy.entropy
93
+ });
94
+ // Read image data from readableStream
95
+ // Write 200px square auto-cropped image data to writableStream
96
+ readableStream
97
+ .pipe(transformer)
98
+ .pipe(writableStream);
99
+ ```
43
100
 
44
- ## crop
101
+ ```javascript
102
+ sharp(input)
103
+ .resize(200, 200, {
104
+ fit: sharp.fit.inside,
105
+ withoutEnlargement: true
106
+ })
107
+ .toFormat('jpeg')
108
+ .toBuffer()
109
+ .then(function(outputBuffer) {
110
+ // outputBuffer contains JPEG image data
111
+ // no wider and no higher than 200 pixels
112
+ // and no larger than the input image
113
+ });
114
+ ```
45
115
 
46
- Crop the resized image to the exact size specified, the default behaviour.
116
+ - Throws **[Error][12]** Invalid parameters
47
117
 
48
- Possible attributes of the optional `sharp.gravity` are `north`, `northeast`, `east`, `southeast`, `south`,
49
- `southwest`, `west`, `northwest`, `center` and `centre`.
118
+ Returns **Sharp**
50
119
 
51
- The experimental strategy-based approach resizes so one dimension is at its target length
52
- then repeatedly ranks edge regions, discarding the edge with the lowest score based on the selected strategy.
120
+ ## extend
53
121
 
54
- - `entropy`: focus on the region with the highest [Shannon entropy][9].
55
- - `attention`: focus on the region with the highest luminance frequency, colour saturation and presence of skin tones.
122
+ Extends/pads the edges of the image with the provided background colour.
123
+ This operation will always occur after resizing and extraction, if any.
56
124
 
57
125
  ### Parameters
58
126
 
59
- - `crop` **[String][6]** A member of `sharp.gravity` to crop to an edge/corner or `sharp.strategy` to crop dynamically. (optional, default `'centre'`)
127
+ - `extend` **([Number][7] \| [Object][8])** single pixel count to add to all edges or an Object with per-edge counts
128
+ - `extend.top` **[Number][7]?**
129
+ - `extend.left` **[Number][7]?**
130
+ - `extend.bottom` **[Number][7]?**
131
+ - `extend.right` **[Number][7]?**
132
+ - `extend.background` **([String][9] \| [Object][8])** background colour, parsed by the [color][10] module, defaults to black without transparency. (optional, default `{r:0,g:0,b:0,alpha:1}`)
60
133
 
61
134
  ### Examples
62
135
 
63
136
  ```javascript
64
- const transformer = sharp()
65
- .resize(200, 200)
66
- .crop(sharp.strategy.entropy)
67
- .on('error', function(err) {
68
- console.log(err);
69
- });
70
- // Read image data from readableStream
71
- // Write 200px square auto-cropped image data to writableStream
72
- readableStream.pipe(transformer).pipe(writableStream);
137
+ // Resize to 140 pixels wide, then add 10 transparent pixels
138
+ // to the top, left and right edges and 20 to the bottom edge
139
+ sharp(input)
140
+ .resize(140)
141
+ .)
142
+ .extend({
143
+ top: 10,
144
+ bottom: 20,
145
+ left: 10,
146
+ right: 10
147
+ background: { r: 0, g: 0, b: 0, alpha: 0 }
148
+ })
149
+ ...
73
150
  ```
74
151
 
75
- - Throws **[Error][8]** Invalid parameters
152
+ - Throws **[Error][12]** Invalid parameters
76
153
 
77
154
  Returns **Sharp**
78
155
 
79
- ## embed
156
+ ## extract
80
157
 
81
- Preserving aspect ratio, resize the image to the maximum `width` or `height` specified
82
- then embed on a background of the exact `width` and `height` specified.
158
+ Extract a region of the image.
83
159
 
84
- If the background contains an alpha value then WebP and PNG format output images will
85
- contain an alpha channel, even when the input image does not.
160
+ - Use `extract` before `resize` for pre-resize extraction.
161
+ - Use `extract` after `resize` for post-resize extraction.
162
+ - Use `extract` before and after for both.
86
163
 
87
164
  ### Parameters
88
165
 
89
- - `embed` **[String][6]** A member of `sharp.gravity` to embed to an edge/corner. (optional, default `'centre'`)
166
+ - `options` **[Object][8]**
167
+ - `options.left` **[Number][7]** zero-indexed offset from left edge
168
+ - `options.top` **[Number][7]** zero-indexed offset from top edge
169
+ - `options.width` **[Number][7]** dimension of extracted image
170
+ - `options.height` **[Number][7]** dimension of extracted image
90
171
 
91
172
  ### Examples
92
173
 
93
174
  ```javascript
94
- sharp('input.gif')
95
- .resize(200, 300)
96
- .background({r: 0, g: 0, b: 0, alpha: 0})
97
- .embed()
98
- .toFormat(sharp.format.webp)
99
- .toBuffer(function(err, outputBuffer) {
100
- if (err) {
101
- throw err;
102
- }
103
- // outputBuffer contains WebP image data of a 200 pixels wide and 300 pixels high
104
- // containing a scaled version, embedded on a transparent canvas, of input.gif
175
+ sharp(input)
176
+ .extract({ left: left, top: top, width: width, height: height })
177
+ .toFile(output, function(err) {
178
+ // Extract a region of the input image, saving in the same format.
105
179
  });
106
180
  ```
107
181
 
108
- - Throws **[Error][8]** Invalid parameters
109
-
110
- Returns **Sharp**
111
-
112
- ## max
113
-
114
- Preserving aspect ratio, resize the image to be as large as possible
115
- while ensuring its dimensions are less than or equal to the `width` and `height` specified.
116
-
117
- Both `width` and `height` must be provided via `resize` otherwise the behaviour will default to `crop`.
118
-
119
- ### Examples
120
-
121
182
  ```javascript
122
- sharp(inputBuffer)
123
- .resize(200, 200)
124
- .max()
125
- .toFormat('jpeg')
126
- .toBuffer()
127
- .then(function(outputBuffer) {
128
- // outputBuffer contains JPEG image data no wider than 200 pixels and no higher
129
- // than 200 pixels regardless of the inputBuffer image dimensions
183
+ sharp(input)
184
+ .extract({ left: leftOffsetPre, top: topOffsetPre, width: widthPre, height: heightPre })
185
+ .resize(width, height)
186
+ .extract({ left: leftOffsetPost, top: topOffsetPost, width: widthPost, height: heightPost })
187
+ .toFile(output, function(err) {
188
+ // Extract a region, resize, then extract from the resized image
130
189
  });
131
190
  ```
132
191
 
192
+ - Throws **[Error][12]** Invalid parameters
193
+
133
194
  Returns **Sharp**
134
195
 
135
- ## min
196
+ ## trim
136
197
 
137
- Preserving aspect ratio, resize the image to be as small as possible
138
- while ensuring its dimensions are greater than or equal to the `width` and `height` specified.
198
+ Trim "boring" pixels from all edges that contain values similar to the top-left pixel.
199
+ The `info` response Object will contain `trimOffsetLeft` and `trimOffsetTop` properties.
139
200
 
140
- Both `width` and `height` must be provided via `resize` otherwise the behaviour will default to `crop`.
201
+ ### Parameters
141
202
 
142
- Returns **Sharp**
203
+ - `threshold` **[Number][7]** the allowed difference from the top-left pixel, a number greater than zero. (optional, default `10`)
143
204
 
144
- ## ignoreAspectRatio
145
205
 
146
- Ignoring the aspect ratio of the input, stretch the image to
147
- the exact `width` and/or `height` provided via `resize`.
206
+ - Throws **[Error][12]** Invalid parameters
148
207
 
149
208
  Returns **Sharp**
150
209
 
151
- ## withoutEnlargement
210
+ [1]: https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit
152
211
 
153
- Do not enlarge the output image if the input image width _or_ height are already less than the required dimensions.
154
- This is equivalent to GraphicsMagick's `>` geometry option:
155
- "_change the dimensions of the image only if its width or height exceeds the geometry specification_".
156
- Use with `max()` to preserve the image's aspect ratio.
212
+ [2]: https://developer.mozilla.org/en-US/docs/Web/CSS/object-position
157
213
 
158
- The default behaviour _before_ function call is `false`, meaning the image will be enlarged.
159
-
160
- ### Parameters
161
-
162
- - `withoutEnlargement` **[Boolean][7]** (optional, default `true`)
163
-
164
- Returns **Sharp**
214
+ [3]: https://en.wikipedia.org/wiki/Entropy_%28information_theory%29
165
215
 
166
- [1]: http://en.wikipedia.org/wiki/Nearest-neighbor_interpolation
216
+ [4]: http://en.wikipedia.org/wiki/Nearest-neighbor_interpolation
167
217
 
168
- [2]: https://en.wikipedia.org/wiki/Centripetal_Catmull%E2%80%93Rom_spline
218
+ [5]: https://en.wikipedia.org/wiki/Centripetal_Catmull%E2%80%93Rom_spline
169
219
 
170
- [3]: https://en.wikipedia.org/wiki/Lanczos_resampling#Lanczos_kernel
220
+ [6]: https://en.wikipedia.org/wiki/Lanczos_resampling#Lanczos_kernel
171
221
 
172
- [4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
222
+ [7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
173
223
 
174
- [5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
224
+ [8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
175
225
 
176
- [6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
226
+ [9]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
177
227
 
178
- [7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
228
+ [10]: https://www.npmjs.org/package/color
179
229
 
180
- [8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error
230
+ [11]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
181
231
 
182
- [9]: https://en.wikipedia.org/wiki/Entropy_%28information_theory%29
232
+ [12]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error
@@ -77,23 +77,20 @@ Requires libvips to have been compiled with liborc support.
77
77
  Improves the performance of `resize`, `blur` and `sharpen` operations
78
78
  by taking advantage of the SIMD vector unit of the CPU, e.g. Intel SSE and ARM NEON.
79
79
 
80
- This feature is currently off by default but future versions may reverse this.
81
- Versions of liborc prior to 0.4.25 are known to segfault under heavy load.
82
-
83
80
  ### Parameters
84
81
 
85
- - `simd` **[Boolean][2]** (optional, default `false`)
82
+ - `simd` **[Boolean][2]** (optional, default `true`)
86
83
 
87
84
  ### Examples
88
85
 
89
86
  ```javascript
90
87
  const simd = sharp.simd();
91
- // simd is `true` if SIMD is currently enabled
88
+ // simd is `true` if the runtime use of liborc is currently enabled
92
89
  ```
93
90
 
94
91
  ```javascript
95
- const simd = sharp.simd(true);
96
- // attempts to enable the use of SIMD, returning true if available
92
+ const simd = sharp.simd(false);
93
+ // prevent libvips from using liborc at runtime
97
94
  ```
98
95
 
99
96
  Returns **[Boolean][2]**
package/docs/changelog.md CHANGED
@@ -1,5 +1,46 @@
1
1
  # Changelog
2
2
 
3
+ ### v0.21 - "*teeth*"
4
+
5
+ Requires libvips v8.7.0.
6
+
7
+ #### v0.21.0 - 4<sup>th</sup> October 2018
8
+
9
+ * Deprecate the following resize-related functions:
10
+ `crop`, `embed`, `ignoreAspectRatio`, `max`, `min` and `withoutEnlargement`.
11
+ Access to these is now via options passed to the `resize` function.
12
+ For example:
13
+ `embed('north')` is now `resize(width, height, { fit: 'contain', position: 'north' })`,
14
+ `crop('attention')` is now `resize(width, height, { fit: 'cover', position: 'attention' })`,
15
+ `max().withoutEnlargement()` is now `resize(width, height, { fit: 'inside', withoutEnlargement: true })`.
16
+ [#1135](https://github.com/lovell/sharp/issues/1135)
17
+
18
+ * Deprecate the `background` function.
19
+ Per-operation `background` options added to `resize`, `extend` and `flatten` operations.
20
+ [#1392](https://github.com/lovell/sharp/issues/1392)
21
+
22
+ * Add `size` to `metadata` response (Stream and Buffer input only).
23
+ [#695](https://github.com/lovell/sharp/issues/695)
24
+
25
+ * Switch from custom trim operation to `vips_find_trim`.
26
+ [#914](https://github.com/lovell/sharp/issues/914)
27
+
28
+ * Add `chromaSubsampling` and `isProgressive` properties to `metadata` response.
29
+ [#1186](https://github.com/lovell/sharp/issues/1186)
30
+
31
+ * Drop Node 4 support.
32
+ [#1212](https://github.com/lovell/sharp/issues/1212)
33
+
34
+ * Enable SIMD convolution by default.
35
+ [#1213](https://github.com/lovell/sharp/issues/1213)
36
+
37
+ * Add experimental prebuilt binaries for musl-based Linux.
38
+ [#1379](https://github.com/lovell/sharp/issues/1379)
39
+
40
+ * Add support for arbitrary rotation angle via vips_rotate.
41
+ [#1385](https://github.com/lovell/sharp/pull/1385)
42
+ [@freezy](https://github.com/freezy)
43
+
3
44
  ### v0.20 - "*prebuild*"
4
45
 
5
46
  Requires libvips v8.6.1.
package/docs/index.md CHANGED
@@ -13,8 +13,8 @@ Lanczos resampling ensures quality is not sacrificed for speed.
13
13
  As well as image resizing, operations such as
14
14
  rotation, extraction, compositing and gamma correction are available.
15
15
 
16
- Most 64-bit OS X, Windows and Linux (glibc) systems running
17
- Node versions 4, 6, 8 and 10
16
+ Most modern 64-bit OS X, Windows and Linux systems running
17
+ Node versions 6, 8 and 10
18
18
  do not require any additional install or runtime dependencies.
19
19
 
20
20
  [![Test Coverage](https://coveralls.io/repos/lovell/sharp/badge.png?branch=master)](https://coveralls.io/r/lovell/sharp?branch=master)
@@ -37,7 +37,7 @@ and [Leaflet](https://github.com/turban/Leaflet.Zoomify).
37
37
  ### Fast
38
38
 
39
39
  This module is powered by the blazingly fast
40
- [libvips](https://github.com/jcupitt/libvips) image processing library,
40
+ [libvips](https://github.com/libvips/libvips) image processing library,
41
41
  originally created in 1989 at Birkbeck College
42
42
  and currently maintained by
43
43
  [John Cupitt](https://github.com/jcupitt).
@@ -118,10 +118,11 @@ the help and code contributions of the following people:
118
118
  * [Alun Davies](https://github.com/alundavies)
119
119
  * [Aidan Hoolachan](https://github.com/ajhool)
120
120
  * [Axel Eirola](https://github.com/aeirola)
121
+ * [Freezy](https://github.com/freezy)
121
122
 
122
123
  Thank you!
123
124
 
124
- ### Licence
125
+ ### Licensing
125
126
 
126
127
  Copyright 2013, 2014, 2015, 2016, 2017, 2018 Lovell Fuller and contributors.
127
128
 
package/docs/install.md CHANGED
@@ -15,7 +15,7 @@ yarn add sharp
15
15
  ### Building from source
16
16
 
17
17
  Pre-compiled binaries for sharp are provided for use with
18
- Node versions 4, 6, 8 and 10 on
18
+ Node versions 6, 8 and 10 on
19
19
  64-bit Windows, OS X and Linux platforms.
20
20
 
21
21
  Sharp will be built from source at install time when:
@@ -27,7 +27,7 @@ Sharp will be built from source at install time when:
27
27
  Building from source requires:
28
28
 
29
29
  * C++11 compatible compiler such as gcc 4.8+, clang 3.0+ or MSVC 2013+
30
- * [node-gyp](https://github.com/TooTallNate/node-gyp#installation) and its dependencies (includes Python)
30
+ * [node-gyp](https://github.com/nodejs/node-gyp#installation) and its dependencies (includes Python 2.7)
31
31
 
32
32
  ## libvips
33
33
 
@@ -36,13 +36,14 @@ Building from source requires:
36
36
  [![Ubuntu 16.04 Build Status](https://travis-ci.org/lovell/sharp.png?branch=master)](https://travis-ci.org/lovell/sharp)
37
37
 
38
38
  libvips and its dependencies are fetched and stored within `node_modules/sharp/vendor` during `npm install`.
39
- This involves an automated HTTPS download of approximately 7MB.
39
+ This involves an automated HTTPS download of approximately 8MB.
40
40
 
41
- Most recent Linux-based operating systems with glibc running on x64 and ARMv6+ CPUs should "just work", e.g.:
41
+ Most Linux-based (glibc, musl) operating systems running on x64 and ARMv6+ CPUs should "just work", e.g.:
42
42
 
43
43
  * Debian 7+
44
44
  * Ubuntu 14.04+
45
45
  * Centos 7+
46
+ * Alpine 3.8+ (Node 8 and 10)
46
47
  * Fedora
47
48
  * openSUSE 13.2+
48
49
  * Archlinux
@@ -61,9 +62,9 @@ and `LD_LIBRARY_PATH` at runtime.
61
62
  This allows the use of newer versions of libvips with older versions of sharp.
62
63
 
63
64
  For 32-bit Intel CPUs and older Linux-based operating systems such as Centos 6,
64
- it is recommended to install a system-wide installation of libvips from source:
65
+ compiling libvips from source is recommended.
65
66
 
66
- https://jcupitt.github.io/libvips/install.html#building-libvips-from-a-source-tarball
67
+ [https://libvips.github.io/libvips/install.html#building-libvips-from-a-source-tarball](https://libvips.github.io/libvips/install.html#building-libvips-from-a-source-tarball)
67
68
 
68
69
  #### Alpine Linux
69
70
 
@@ -71,7 +72,7 @@ libvips is available in the
71
72
  [testing repository](https://pkgs.alpinelinux.org/packages?name=vips-dev):
72
73
 
73
74
  ```sh
74
- apk add vips-dev fftw-dev --update-cache --repository https://dl-3.alpinelinux.org/alpine/edge/testing/
75
+ apk add vips-dev fftw-dev build-base --update-cache --repository https://dl-3.alpinelinux.org/alpine/edge/testing/
75
76
  ```
76
77
 
77
78
  The smaller stack size of musl libc means
@@ -94,7 +95,7 @@ that it can be located using `pkg-config --modversion vips-cpp`.
94
95
  [![Windows x64 Build Status](https://ci.appveyor.com/api/projects/status/pgtul704nkhhg6sg)](https://ci.appveyor.com/project/lovell/sharp)
95
96
 
96
97
  libvips and its dependencies are fetched and stored within `node_modules\sharp\vendor` during `npm install`.
97
- This involves an automated HTTPS download of approximately 12MB.
98
+ This involves an automated HTTPS download of approximately 13MB.
98
99
 
99
100
  Only 64-bit (x64) `node.exe` is supported.
100
101
 
@@ -117,9 +118,6 @@ https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=193528
117
118
 
118
119
  ### Heroku
119
120
 
120
- libvips and its dependencies are fetched and stored within `node_modules\sharp\vendor` during `npm install`.
121
- This involves an automated HTTPS download of approximately 7MB.
122
-
123
121
  Set [NODE_MODULES_CACHE](https://devcenter.heroku.com/articles/nodejs-support#cache-behavior)
124
122
  to `false` when using the `yarn` package manager.
125
123
 
@@ -154,12 +152,13 @@ can be built using Docker.
154
152
 
155
153
  ```sh
156
154
  rm -rf node_modules/sharp
157
- docker run -v "$PWD":/var/task lambci/lambda:build-nodejs6.10 npm install
155
+ docker run -v "$PWD":/var/task lambci/lambda:build-nodejs8.10 npm install
158
156
  ```
159
157
 
160
- Set the Lambda runtime to Node.js 6.10.
158
+ Set the Lambda runtime to Node.js 8.10.
161
159
 
162
- To get the best performance select the largest memory available. A 1536 MB function provides ~12x more CPU time than a 128 MB function.
160
+ To get the best performance select the largest memory available.
161
+ A 1536 MB function provides ~12x more CPU time than a 128 MB function.
163
162
 
164
163
  ### NW.js
165
164
 
@@ -171,7 +170,7 @@ nw-gyp rebuild --arch=x64 --target=[your nw version]
171
170
  node node_modules/sharp/install/dll-copy
172
171
  ```
173
172
 
174
- See also http://docs.nwjs.io/en/latest/For%20Users/Advanced/Use%20Native%20Node%20Modules/
173
+ [http://docs.nwjs.io/en/latest/For%20Users/Advanced/Use%20Native%20Node%20Modules/](http://docs.nwjs.io/en/latest/For%20Users/Advanced/Use%20Native%20Node%20Modules/)
175
174
 
176
175
  ### Build tools
177
176
 
@@ -199,28 +198,6 @@ and [Valgrind](http://valgrind.org/) have been used to test
199
198
  the most popular web-based formats, as well as libvips itself,
200
199
  you are advised to perform your own testing and sandboxing.
201
200
 
202
- ImageMagick in particular has a relatively large attack surface,
203
- which can be partially mitigated with a
204
- [policy.xml](http://www.imagemagick.org/script/resources.php)
205
- configuration file to prevent the use of coders known to be vulnerable.
206
-
207
- ```xml
208
- <policymap>
209
- <policy domain="coder" rights="none" pattern="EPHEMERAL" />
210
- <policy domain="coder" rights="none" pattern="URL" />
211
- <policy domain="coder" rights="none" pattern="HTTPS" />
212
- <policy domain="coder" rights="none" pattern="MVG" />
213
- <policy domain="coder" rights="none" pattern="MSL" />
214
- <policy domain="coder" rights="none" pattern="TEXT" />
215
- <policy domain="coder" rights="none" pattern="SHOW" />
216
- <policy domain="coder" rights="none" pattern="WIN" />
217
- <policy domain="coder" rights="none" pattern="PLT" />
218
- </policymap>
219
- ```
220
-
221
- Set the `MAGICK_CONFIGURE_PATH` environment variable
222
- to the directory containing the `policy.xml` file.
223
-
224
201
  ### Pre-compiled libvips binaries
225
202
 
226
203
  This module will attempt to download a pre-compiled bundle of libvips
@@ -236,7 +213,8 @@ SHARP_IGNORE_GLOBAL_LIBVIPS=1 npm install sharp
236
213
  ```
237
214
 
238
215
  Should you need to manually download and inspect these files,
239
- you can do so via https://github.com/lovell/sharp-libvips/releases
216
+ you can do so via
217
+ [https://github.com/lovell/sharp-libvips/releases](https://github.com/lovell/sharp-libvips/releases)
240
218
 
241
219
  Should you wish to install these from your own location,
242
220
  set the `SHARP_DIST_BASE_URL` environment variable, e.g.
@@ -265,6 +243,8 @@ Use of libraries under the terms of the LGPLv3 is via the
265
243
  | expat | MIT Licence |
266
244
  | fontconfig | [fontconfig Licence](https://cgit.freedesktop.org/fontconfig/tree/COPYING) (BSD-like) |
267
245
  | freetype | [freetype Licence](http://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/docs/FTL.TXT) (BSD-like) |
246
+ | fribidi | LGPLv3 |
247
+ | gettext | LGPLv3 |
268
248
  | giflib | MIT Licence |
269
249
  | glib | LGPLv3 |
270
250
  | harfbuzz | MIT Licence |