Fix defining Mask for grayscale transparent PNG files

This commit is contained in:
Luiz Américo 2018-12-22 22:21:42 -03:00
parent eb60ed1efd
commit faad6e82db

View File

@ -49,10 +49,10 @@ class PNGImage {
// For PNG color types 0, 2 and 3, the transparency data is stored in
// a dedicated PNG chunk.
if (this.image.transparency.grayscale) {
if (this.image.transparency.grayscale != null) {
// Use Color Key Masking (spec section 4.8.5)
// An array with N elements, where N is two times the number of color components.
const val = this.image.transparency.greyscale;
const val = this.image.transparency.grayscale;
return this.obj.data['Mask'] = [val, val];
} else if (this.image.transparency.rgb) {