Fixes for #88 and #93 (#94)

This commit is contained in:
Jesus Nuevo 2017-11-15 17:47:10 +11:00 committed by Luke Page
parent 08534acc84
commit bdc384e9c3

View file

@ -22,6 +22,7 @@ module.exports = function(dataIn, width, height, options) {
var maxValue = 255;
var inBpp = constants.COLORTYPE_TO_BPP_MAP[options.inputColorType];
if (inBpp == 4 && !options.inputHasAlpha) inBpp = 3;
var outBpp = constants.COLORTYPE_TO_BPP_MAP[options.colorType];
if (options.bitDepth === 16) {
maxValue = 65535;
@ -80,7 +81,7 @@ module.exports = function(dataIn, width, height, options) {
blue = Math.min(Math.max(Math.round((1 - alpha) * bgColor.blue + alpha * blue), 0), maxValue);
}
}
return {red, green, blue, alpha};
return {red: red, green: green, blue: blue, alpha: alpha};
}
for (var y = 0; y < height; y++) {