mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 02:30:12 +02:00
Docs refresh
This commit is contained in:
parent
99076edc89
commit
d5873a00d5
@ -23,7 +23,7 @@ the installation of any external runtime dependencies.
|
||||
## Examples
|
||||
|
||||
```javascript
|
||||
import sharp from 'sharp';
|
||||
const sharp = require('sharp');
|
||||
```
|
||||
|
||||
```javascript
|
||||
@ -33,8 +33,6 @@ sharp(inputBuffer)
|
||||
// A Promises/A+ promise is returned when callback is not provided.
|
||||
```
|
||||
|
||||
|
||||
|
||||
```javascript
|
||||
sharp('input.jpg')
|
||||
.rotate()
|
||||
|
@ -29,6 +29,7 @@ A Promises/A+ promise is returned when `callback` is not provided.
|
||||
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)?** called on completion with two arguments `(err, info)`.
|
||||
`info` contains the output image `format`, `size` (bytes), `width`, `height`,
|
||||
`channels` and `premultiplied` (indicating if premultiplication was used).
|
||||
When using a crop strategy also contains `cropOffsetLeft` and `cropOffsetTop`.
|
||||
|
||||
|
||||
- Throws **[Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error)** Invalid parameters
|
||||
@ -102,8 +103,8 @@ Use these PNG options for output image.
|
||||
|
||||
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?**
|
||||
- `options.progressive` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** use progressive (interlace) scan (optional, default `false`)
|
||||
- `options.compressionLevel` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** zlib compression level (optional, default `6`)
|
||||
- `options.adaptiveFiltering` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** use adaptive row filtering (optional, default `true`)
|
||||
- `options.compressionLevel` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** zlib compression level, 0-9 (optional, default `9`)
|
||||
- `options.adaptiveFiltering` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** use adaptive row filtering (optional, default `false`)
|
||||
- `options.force` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** force PNG output, otherwise attempt to use input format (optional, default `true`)
|
||||
|
||||
|
||||
|
@ -55,9 +55,9 @@ without having to use separate command line tools like
|
||||
[jpegoptim](https://github.com/tjko/jpegoptim) and
|
||||
[jpegtran](http://jpegclub.org/jpegtran/).
|
||||
|
||||
PNG filtering can be disabled,
|
||||
PNG filtering is disabled by default,
|
||||
which for diagrams and line art often produces the same result
|
||||
as [pngcrush](http://pmt.sourceforge.net/pngcrush/).
|
||||
as [pngcrush](https://pmt.sourceforge.io/pngcrush/).
|
||||
|
||||
### Contributing
|
||||
|
||||
|
@ -16,7 +16,7 @@ yarn add sharp
|
||||
|
||||
### Linux
|
||||
|
||||
[](https://travis-ci.org/lovell/sharp)
|
||||
[](https://travis-ci.org/lovell/sharp)
|
||||
[](https://circleci.com/gh/lovell/sharp)
|
||||
|
||||
libvips and its dependencies are fetched and stored within `node_modules/sharp/vendor` during `npm install`.
|
||||
@ -25,13 +25,13 @@ This involves an automated HTTPS download of approximately 7MB.
|
||||
Most recent Linux-based operating systems with glibc running on x64 and ARMv6+ CPUs should "just work", e.g.:
|
||||
|
||||
* Debian 7, 8
|
||||
* Ubuntu 12.04, 14.04, 16.04
|
||||
* Ubuntu 14.04, 16.04
|
||||
* Centos 7
|
||||
* Fedora
|
||||
* openSUSE 13.2
|
||||
* Archlinux
|
||||
* Raspbian Jessie
|
||||
* Amazon Linux 2016.03, 2016.09
|
||||
* Amazon Linux 2017.03.1
|
||||
* Solus
|
||||
|
||||
To use a globally-installed version of libvips instead of the provided binaries,
|
||||
@ -78,7 +78,7 @@ that it can be located using `pkg-config --modversion vips-cpp`.
|
||||
[](https://ci.appveyor.com/project/lovell/sharp)
|
||||
|
||||
libvips and its dependencies are fetched and stored within `node_modules\sharp\vendor` during `npm install`.
|
||||
This involves an automated HTTPS download of approximately 11MB.
|
||||
This involves an automated HTTPS download of approximately 12MB.
|
||||
|
||||
Only 64-bit (x64) `node.exe` is supported.
|
||||
|
||||
|
@ -78,7 +78,7 @@
|
||||
"devDependencies": {
|
||||
"async": "^2.5.0",
|
||||
"cc": "^1.0.1",
|
||||
"documentation": "^4.0.0-rc.1",
|
||||
"documentation": "^5.3.2",
|
||||
"exif-reader": "^1.0.2",
|
||||
"icc": "^1.0.0",
|
||||
"mocha": "^3.5.0",
|
||||
|
Loading…
x
Reference in New Issue
Block a user