mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 18:40:16 +02:00
Update docs to reflect ease-of-installation
This commit is contained in:
parent
05cec013fe
commit
ee8fcb6109
@ -6,16 +6,10 @@ Hello, thank you for your interest in helping!
|
|||||||
|
|
||||||
Please create a [new issue](https://github.com/lovell/sharp/issues/new) containing the steps to reproduce the problem.
|
Please create a [new issue](https://github.com/lovell/sharp/issues/new) containing the steps to reproduce the problem.
|
||||||
|
|
||||||
|
If you're having installation problems, please include the output of running `npm install --verbose sharp`.
|
||||||
|
|
||||||
New bugs are assigned a `triage` label whilst under investigation.
|
New bugs are assigned a `triage` label whilst under investigation.
|
||||||
|
|
||||||
If you're having problems with `npm install sharp`, please include the output of the following commands, perhaps as a [gist](https://gist.github.com/):
|
|
||||||
|
|
||||||
```sh
|
|
||||||
vips -v
|
|
||||||
pkg-config --print-provides vips
|
|
||||||
npm install --verbose sharp
|
|
||||||
```
|
|
||||||
|
|
||||||
## Submit a new feature request
|
## Submit a new feature request
|
||||||
|
|
||||||
If a [similar request](https://github.com/lovell/sharp/labels/enhancement) exists, it's probably fastest to add a comment to it about your requirement.
|
If a [similar request](https://github.com/lovell/sharp/labels/enhancement) exists, it's probably fastest to add a comment to it about your requirement.
|
||||||
@ -84,6 +78,15 @@ Requires [Valgrind](http://valgrind.org/).
|
|||||||
npm run test-leak
|
npm run test-leak
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Packaging tests
|
||||||
|
|
||||||
|
Tests the installation on a number of Linux-based operating systems.
|
||||||
|
Requires docker.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm run test-packaging
|
||||||
|
```
|
||||||
|
|
||||||
## Finally
|
## Finally
|
||||||
|
|
||||||
Please feel free to ask any questions via a [new issue](https://github.com/lovell/sharp/issues/new) or contact me by [e-mail](https://github.com/lovell/sharp/blob/master/package.json#L4).
|
Please feel free to ask any questions via a [new issue](https://github.com/lovell/sharp/issues/new) or contact me by [e-mail](https://github.com/lovell/sharp/blob/master/package.json#L4).
|
||||||
|
@ -4,6 +4,12 @@ The typical use case for this high speed Node.js module
|
|||||||
is to convert large images of many formats to
|
is to convert large images of many formats to
|
||||||
smaller, web-friendly JPEG, PNG and WebP images of varying dimensions.
|
smaller, web-friendly JPEG, PNG and WebP images of varying dimensions.
|
||||||
|
|
||||||
|
`npm install sharp`
|
||||||
|
|
||||||
|
A pre-built version of libvips is provided for Windows and most Linux systems.
|
||||||
|
|
||||||
|
Installation of libvips on OS X is as simple as `brew install homebrew/science/vips`.
|
||||||
|
|
||||||
[](https://coveralls.io/r/lovell/sharp?branch=master)
|
[](https://coveralls.io/r/lovell/sharp?branch=master)
|
||||||
|
|
||||||
### Documentation
|
### Documentation
|
||||||
|
@ -6,72 +6,41 @@ npm install sharp
|
|||||||
|
|
||||||
### Prerequisites
|
### Prerequisites
|
||||||
|
|
||||||
* Node.js v0.10+ or io.js
|
* C++11 compatible compiler such as gcc 4.6+ (Node v4+ requires gcc 4.8+), clang 3.0+ or MSVC 2013
|
||||||
* [libvips](https://github.com/jcupitt/libvips) v7.40.0+ (8.1.1+ recommended)
|
* [node-gyp](https://github.com/TooTallNate/node-gyp#installation)
|
||||||
* C++11 compatible compiler such as gcc 4.6+, clang 3.0+ or MSVC 2013 (Node v4+ requires gcc 4.8+)
|
|
||||||
|
|
||||||
### Linux
|
### Linux
|
||||||
|
|
||||||
[](https://travis-ci.org/lovell/sharp)
|
[](https://travis-ci.org/lovell/sharp)
|
||||||
[](https://snap-ci.com/lovell/sharp/branch/master)
|
|
||||||
|
|
||||||
For a system-wide installation of the most suitable version of
|
libvips and its dependencies are fetched and stored within `node_modules/sharp` during `npm install`.
|
||||||
libvips and its dependencies on the following Operating Systems:
|
This involves an automated HTTPS download of approximately 6MB.
|
||||||
|
|
||||||
* Debian 7, 8
|
Most recent 64-bit Linux-based operating systems should "just work", e.g.:
|
||||||
|
|
||||||
|
* Debian 8
|
||||||
* Ubuntu 12.04, 14.04, 14.10, 15.04, 15.10
|
* Ubuntu 12.04, 14.04, 14.10, 15.04, 15.10
|
||||||
* Mint 13, 17
|
* Centos 7
|
||||||
* Elementary 0.3
|
* Fedora 20, 21
|
||||||
* RHEL/Centos/Scientific 6, 7
|
* openSUSE 13.2
|
||||||
* Fedora 21, 22
|
* Archlinux 2015.06.01
|
||||||
* Amazon Linux 2015.03, 2015.09
|
|
||||||
* OpenSuse 13
|
|
||||||
|
|
||||||
run the following as a user with `sudo` access:
|
For older and 32-bit Linux-based operating systems,
|
||||||
|
a system-wide installation of the most suitable version of
|
||||||
|
libvips and its dependencies can be achieved by running
|
||||||
|
the following command as a user with `sudo` access
|
||||||
|
(requires `curl` and `pkg-config`):
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -s https://raw.githubusercontent.com/lovell/sharp/master/preinstall.sh | sudo bash -
|
curl -s https://raw.githubusercontent.com/lovell/sharp/master/preinstall.sh | sudo bash -
|
||||||
```
|
```
|
||||||
|
|
||||||
or run the following as `root`:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
curl -s https://raw.githubusercontent.com/lovell/sharp/master/preinstall.sh | bash -
|
|
||||||
```
|
|
||||||
|
|
||||||
The [preinstall.sh](https://github.com/lovell/sharp/blob/master/preinstall.sh) script requires `curl` and `pkg-config`.
|
|
||||||
|
|
||||||
Add `--with-openslide` to enable OpenSlide support:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
curl -s https://raw.githubusercontent.com/lovell/sharp/master/preinstall.sh | sudo bash -s -- --with-openslide
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Ubuntu LTS
|
|
||||||
|
|
||||||
libvips v7.40.6 is available via a PPA.
|
|
||||||
|
|
||||||
##### 12.04
|
|
||||||
|
|
||||||
```sh
|
|
||||||
sudo add-apt-repository -y ppa:lovell/precise-backport-vips
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y libvips-dev libgsf-1-dev
|
|
||||||
```
|
|
||||||
|
|
||||||
##### 14.04
|
|
||||||
|
|
||||||
```sh
|
|
||||||
sudo add-apt-repository -y ppa:lovell/trusty-backport-vips
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y libvips-dev libgsf-1-dev
|
|
||||||
```
|
|
||||||
|
|
||||||
### Mac OS
|
### Mac OS
|
||||||
|
|
||||||
[](https://travis-ci.org/lovell/sharp-osx-ci)
|
[](https://travis-ci.org/lovell/sharp-osx-ci)
|
||||||
|
|
||||||
Install libvips via homebrew:
|
libvips must be installed before `npm install` is run.
|
||||||
|
This can be achieved via homebrew:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
brew install homebrew/science/vips --with-webp --with-graphicsmagick
|
brew install homebrew/science/vips --with-webp --with-graphicsmagick
|
||||||
@ -89,18 +58,13 @@ If so, please try `brew link gettext --force`.
|
|||||||
|
|
||||||
### Windows
|
### Windows
|
||||||
|
|
||||||
[](https://ci.appveyor.com/project/lovell/sharp)
|
[](https://ci.appveyor.com/project/lovell/sharp)
|
||||||
|
|
||||||
Requires x86 32-bit Node.js or io.js (use `iojs.exe` rather than `node.exe`).
|
libvips and its dependencies are fetched and stored within `node_modules\sharp` during `npm install`.
|
||||||
|
This involves an automated HTTPS download of approximately 11MB.
|
||||||
|
|
||||||
The WebP format is currently unsupported.
|
Only 64-bit (x64) `node.exe` is supported.
|
||||||
|
The WebP format is currently unavailable on Windows.
|
||||||
1. Ensure the [node-gyp prerequisites](https://github.com/TooTallNate/node-gyp#installation) are met.
|
|
||||||
2. [Download](http://www.vips.ecs.soton.ac.uk/supported/current/win32/) and unzip `vips-dev.x.y.z.zip`.
|
|
||||||
3. Set the `VIPS_HOME` environment variable to the full path of the `vips-dev-x.y.z` directory.
|
|
||||||
4. Add `vips-dev-x.y.z\bin` to `PATH`.
|
|
||||||
|
|
||||||
Versions of MSVC more recent than 2013 may require the use of `npm install --arch=ia32 --msvs_version=2013`.
|
|
||||||
|
|
||||||
### Heroku
|
### Heroku
|
||||||
|
|
||||||
@ -110,13 +74,20 @@ and its dependencies.
|
|||||||
|
|
||||||
### Docker
|
### Docker
|
||||||
|
|
||||||
[Marc Bachmann](https://github.com/marcbachmann) maintains a
|
[Marc Bachmann](https://github.com/marcbachmann) maintains an
|
||||||
[Dockerfile for libvips](https://github.com/marcbachmann/dockerfile-libvips).
|
[Ubuntu-based Dockerfile for libvips](https://github.com/marcbachmann/dockerfile-libvips).
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
docker pull marcbachmann/libvips
|
docker pull marcbachmann/libvips
|
||||||
```
|
```
|
||||||
|
|
||||||
|
[Will Jordan](https://github.com/wjordan) maintains an
|
||||||
|
[Alpine-based Dockerfile for libvips](https://github.com/wjordan/dockerfile-libvips).
|
||||||
|
|
||||||
|
```sh
|
||||||
|
docker pull wjordan/libvips
|
||||||
|
```
|
||||||
|
|
||||||
### Build tools
|
### Build tools
|
||||||
|
|
||||||
* [gulp-responsive](https://www.npmjs.com/package/gulp-responsive)
|
* [gulp-responsive](https://www.npmjs.com/package/gulp-responsive)
|
||||||
|
@ -34,7 +34,6 @@ fi
|
|||||||
|
|
||||||
# Centos 7
|
# Centos 7
|
||||||
# Fedora 20, 21
|
# Fedora 20, 21
|
||||||
|
|
||||||
for dist in centos7 fedora20 fedora21; do
|
for dist in centos7 fedora20 fedora21; do
|
||||||
echo -n "Testing $dist... "
|
echo -n "Testing $dist... "
|
||||||
if docker run -i -t --rm -v $PWD:/v nodesource/$dist:0.12 sh -c "cd /v && $test" >/dev/null;
|
if docker run -i -t --rm -v $PWD:/v nodesource/$dist:0.12 sh -c "cd /v && $test" >/dev/null;
|
||||||
@ -45,14 +44,14 @@ done
|
|||||||
|
|
||||||
# openSUSE 13.2
|
# openSUSE 13.2
|
||||||
echo -n "Testing opensuse... "
|
echo -n "Testing opensuse... "
|
||||||
docker run -i -t --rm -v $PWD:/v opensuse:13.2 sh -c "cd /v && ./packaging/test/opensuse.sh && $test" >/dev/null;
|
if docker run -i -t --rm -v $PWD:/v opensuse:13.2 sh -c "cd /v && ./packaging/test/opensuse.sh && $test" >/dev/null;
|
||||||
then echo "OK"
|
then echo "OK"
|
||||||
else echo "fail"
|
else echo "fail"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Archlinux 2015.06.01
|
# Archlinux 2015.06.01
|
||||||
echo -n "Testing archlinux... "
|
echo -n "Testing archlinux... "
|
||||||
docker run -i -t --rm -v $PWD:/v base/archlinux:2015.06.01 sh -c "cd /v && ./packaging/test/archlinux.sh && $test" >/dev/null;
|
if docker run -i -t --rm -v $PWD:/v base/archlinux:2015.06.01 sh -c "cd /v && ./packaging/test/archlinux.sh && $test" >/dev/null;
|
||||||
then echo "OK"
|
then echo "OK"
|
||||||
else echo "fail"
|
else echo "fail"
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user