From 4c508c661e06434a1b0acdd6d232443af95e54b4 Mon Sep 17 00:00:00 2001 From: Luke Page Date: Thu, 30 Jul 2015 18:35:45 +0100 Subject: [PATCH] Clarified png.parse() (from @stevenvanchon) --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 941fb19..b8b6e5b 100644 --- a/README.md +++ b/README.md @@ -83,13 +83,20 @@ Input image has been completly parsed, `data` is complete and ready for modifica ### png.parse(data, [callback]) -Parses PNG file data. Alternatively you can stream data to instance of PNG. +Parses PNG file data. Can be `String` or `Buffer`. Alternatively you can stream data to instance of PNG. Optional `callback` is once called on `error` or `parsed`. The callback gets two arguments `(err, data)`. Returns `this` for method chaining. ++#### Example +```js +new PNG({ filterType:4 }).parse( imageData, function(error, data) +{ + console.log(error, data) +}); +``` ### png.pack() Starts converting data to PNG file Stream.