imagemin-upng
Advanced tools
Comparing version 1.0.3 to 1.0.4
11
index.js
@@ -7,3 +7,3 @@ 'use strict'; | ||
module.exports = function(opts) { | ||
opts = opts || {}; | ||
opts = Object.assign({cnum: 256}, opts); | ||
@@ -19,11 +19,6 @@ return function(buf) { | ||
var cnum = opts.cnum; | ||
if (isNaN(cnum)) { | ||
cnum = 256; | ||
} | ||
var oriImg = upng.decode(buf); | ||
var oriRGBA = upng.toRGBA8(oriImg).buffer; | ||
var comArrayBuff = upng.encode(oriRGBA, oriImg.width, oriImg.height, cnum); | ||
var comArrayBuff = upng.encode(oriRGBA, oriImg.width, oriImg.height, opts.cnum); | ||
var comBuffer = Buffer.from(comArrayBuff) | ||
@@ -33,2 +28,2 @@ | ||
}; | ||
}; | ||
}; |
{ | ||
"name": "imagemin-upng", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "upng imagemin plugin", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
2879
19