From 9e7ff193f644606b8bc4e22fe23ec032394940d9 Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Sun, 8 Oct 2017 10:02:08 +0100 Subject: [PATCH] Doc refresh and changelog entry for #976 --- docs/api-constructor.md | 3 +++ docs/changelog.md | 4 ++++ docs/index.md | 1 + package.json | 5 +++-- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/api-constructor.md b/docs/api-constructor.md index b5b48b2b0..44152e02f 100644 --- a/docs/api-constructor.md +++ b/docs/api-constructor.md @@ -16,6 +16,9 @@ a String containing the path to an JPEG, PNG, WebP, GIF, SVG or TIFF image file. JPEG, PNG, WebP, GIF, SVG, TIFF or raw pixel image data can be streamed into the object when not present. - `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** if present, is an Object with optional attributes. + - `options.failOnError` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** by default apply a "best effort" + to decode images, even if the data is corrupt or invalid. Set this flag to true + if you'd rather halt processing and raise an error when loading invalid images. (optional, default `false`) - `options.density` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** integral number representing the DPI for vector images. (optional, default `72`) - `options.raw` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** describes raw pixel input image data. See `raw()` for pixel ordering. - `options.raw.width` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** diff --git a/docs/changelog.md b/docs/changelog.md index ff9360d8d..de743a299 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -14,6 +14,10 @@ Requires libvips v8.6.0. [#872](https://github.com/lovell/sharp/issues/872) [@wmertens](https://github.com/wmertens) +* Add failOnError option to fail-fast on bad input image data. + [#976](https://github.com/lovell/sharp/pull/976) + [@mceachen](https://github.com/mceachen) + ### v0.18 - "*ridge*" Requires libvips v8.5.5. diff --git a/docs/index.md b/docs/index.md index c81b6895e..fbe98cd87 100644 --- a/docs/index.md +++ b/docs/index.md @@ -102,6 +102,7 @@ the help and code contributions of the following people: * [Yves Bos](https://github.com/YvesBos) * [Nicolas Coden](https://github.com/ncoden) * [Matt Parrish](https://github.com/pbomb) +* [Matthew McEachen](https://github.com/mceachen) Thank you! diff --git a/package.json b/package.json index 98960142b..6ad64d977 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,8 @@ "YvesBos ", "Guy Maliar ", "Nicolas Coden ", - "Matt Parrish " + "Matt Parrish ", + "Matthew McEachen " ], "scripts": { "clean": "rm -rf node_modules/ build/ vendor/ coverage/ test/fixtures/output.*", @@ -81,7 +82,7 @@ "documentation": "^5.3.2", "exif-reader": "^1.0.2", "icc": "^1.0.0", - "mocha": "^3.5.0", + "mocha": "^4.0.1", "nyc": "^11.1.0", "rimraf": "^2.6.1", "semistandard": "^11.0.0",