Skip to content
This repository was archived by the owner on Apr 12, 2021. It is now read-only.

Commit faad6e8

Browse files
committed
Fix defining Mask for grayscale transparent PNG files
1 parent eb60ed1 commit faad6e8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/image/png.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ class PNGImage {
4949

5050
// For PNG color types 0, 2 and 3, the transparency data is stored in
5151
// a dedicated PNG chunk.
52-
if (this.image.transparency.grayscale) {
52+
if (this.image.transparency.grayscale != null) {
5353
// Use Color Key Masking (spec section 4.8.5)
5454
// An array with N elements, where N is two times the number of color components.
55-
const val = this.image.transparency.greyscale;
55+
const val = this.image.transparency.grayscale;
5656
return this.obj.data['Mask'] = [val, val];
5757

5858
} else if (this.image.transparency.rgb) {

0 commit comments

Comments
 (0)