mirror of
https://github.com/foliojs/pdfkit.git
synced 2025-12-08 20:15:54 +00:00
Fix defining Mask for grayscale transparent PNG files
This commit is contained in:
parent
eb60ed1efd
commit
faad6e82db
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user