diff --git a/docs/api-constructor.md b/docs/api-constructor.md index b5b48b2b..44152e02 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 ff9360d8..de743a29 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 c81b6895..fbe98cd8 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 98960142..6ad64d97 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",