From 86a114be2f3a75d4f61ad58dc538392e8cc06373 Mon Sep 17 00:00:00 2001 From: Luke Page Date: Sun, 2 Aug 2015 11:50:19 +0100 Subject: [PATCH] Add interlaced to meta data --- README.md | 1 + lib/parser.js | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f6fc6b8..9b75fde 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,7 @@ Image's header has been parsed, metadata contains this information: - `palette` image is paletted - `color` image is not grayscale - `alpha` image contains alpha channel +- `interlace` image is interlaced ### Event: "parsed" diff --git a/lib/parser.js b/lib/parser.js index 16ca84b..cce23c2 100644 --- a/lib/parser.js +++ b/lib/parser.js @@ -187,7 +187,8 @@ Parser.prototype._parseIHDR = function(data) { this._colorType = colorType; - this.createData(width, height, colorTypeToBppMap[this._colorType], depth, interlace); + var bpp = colorTypeToBppMap[this._colorType]; + this.createData(width, height, bpp, depth, interlace); this._hasIHDR = true; @@ -195,6 +196,7 @@ Parser.prototype._parseIHDR = function(data) { width: width, height: height, depth: depth, + interlace: interlace, palette: !!(colorType & constants.COLOR_PALETTE), color: !!(colorType & constants.COLOR_COLOR), alpha: !!(colorType & constants.COLOR_ALPHA)