mirror of
https://github.com/danbulant/pngjs
synced 2026-07-09 13:10:46 +00:00
Clarified png.parse() (from @stevenvanchon)
This commit is contained in:
parent
dbe7fbe390
commit
4c508c661e
1 changed files with 8 additions and 1 deletions
|
|
@ -83,13 +83,20 @@ Input image has been completly parsed, `data` is complete and ready for modifica
|
||||||
|
|
||||||
|
|
||||||
### png.parse(data, [callback])
|
### 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
|
Optional `callback` is once called on `error` or `parsed`. The callback gets
|
||||||
two arguments `(err, data)`.
|
two arguments `(err, data)`.
|
||||||
|
|
||||||
Returns `this` for method chaining.
|
Returns `this` for method chaining.
|
||||||
|
|
||||||
|
+#### Example
|
||||||
|
```js
|
||||||
|
new PNG({ filterType:4 }).parse( imageData, function(error, data)
|
||||||
|
{
|
||||||
|
console.log(error, data)
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
### png.pack()
|
### png.pack()
|
||||||
Starts converting data to PNG file Stream.
|
Starts converting data to PNG file Stream.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue