Improve SVG support by allowing control of density/DPI

Switch pre-built libs from Imagemagick to Graphicsmagick
This commit is contained in:
Lovell Fuller
2016-02-01 18:21:03 +00:00
parent 56508e8d79
commit cf7664a854
15 changed files with 158 additions and 93 deletions

View File

@@ -6,23 +6,27 @@ var sharp = require('sharp');
### Input
#### sharp([input])
#### sharp([input], [options])
Constructor to which further methods are chained. `input`, if present, can be one of:
Constructor to which further methods are chained.
* Buffer containing JPEG, PNG, WebP, GIF* or TIFF image data, or
`input`, if present, can be one of:
* Buffer containing JPEG, PNG, WebP, GIF, SVG or TIFF image data, or
* String containing the path to an image file, with most major formats supported.
The object returned implements the
JPEG, PNG, WebP, GIF, SVG or TIFF format image data
can be streamed into the object when `input` is `null` or `undefined`.
`options`, if present, is an Object with the following optional attributes:
* `density` an integral number representing the DPI for vector images, defaulting to 72.
The object returned by the constructor implements the
[stream.Duplex](http://nodejs.org/api/stream.html#stream_class_stream_duplex) class.
JPEG, PNG, WebP, GIF* or TIFF format image data
can be streamed into the object when `input` is not provided.
JPEG, PNG or WebP format image data can be streamed out from this object.
\* libvips 8.0.0+ is required for Buffer/Stream input of GIF and other `magick` formats.
```javascript
sharp('input.jpg')
.resize(300, 200)

View File

@@ -2,11 +2,19 @@
### v0.13 - "*mind*"
#### v0.13.0 - TBD
* Improve vector image support by allowing control of density/DPI.
Switch pre-built libs from Imagemagick to Graphicsmagick.
[#110](https://github.com/lovell/sharp/issues/110)
[@bradisbell](https://github.com/bradisbell)
* Switch from libvips' C to C++ bindings, requires upgrade to v8.2.2.
[#299](https://github.com/lovell/sharp/issues/299)
* Control number of open files in libvips' cache; breaks existing `cache` behaviour.
[#315](https://github.com/lovell/sharp/issues/315)
[@impomezia](https://github.com/impomezia)
* Ensure 16-bit input images can be embedded onto a transparent background.
[#340](https://github.com/lovell/sharp/issues/340)

View File

@@ -15,7 +15,7 @@ npm install sharp
[![Linux Build Status](https://circleci.com/gh/lovell/sharp.svg?style=svg&circle-token=6cb6d1d287a51af83722b19ed8885377fbc85e5c)](https://circleci.com/gh/lovell/sharp)
libvips and its dependencies are fetched and stored within `node_modules/sharp` during `npm install`.
This involves an automated HTTPS download of approximately 7MB.
This involves an automated HTTPS download of approximately 6MB.
Most recent Linux-based operating systems running on x64 and ARMv6+ CPUs should "just work", e.g.: