Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@

### Unreleased

### [v0.17.3] - 2025-09-09

- fixed png images rendering issues for qrcode


### [v0.17.2] - 2025-08-30

- Fix rendering lists that spans across pages


### [v0.17.1] - 2025-05-02

- Fix null values in table cells rendering as `[object Object]`
Expand Down
2 changes: 1 addition & 1 deletion lib/image/png.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class PNGImage {
}

finalize() {
if (this.alphaChannel) {
if (this.image.hasAlphaChannel && this.alphaChannel) {
const sMask = this.document.ref({
Type: 'XObject',
Subtype: 'Image',
Expand Down
13 changes: 0 additions & 13 deletions tests/unit/png.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ describe('PNGImage', () => {
Type: 'XObject',
Width: 32,
DecodeParms: expect.any(PDFReference),
SMask: expect.any(PDFReference),
});

expect(img.obj.data.DecodeParms.data).toMatchObject({
Expand All @@ -246,18 +245,6 @@ describe('PNGImage', () => {
Columns: 32,
Predictor: 15,
});

expect(img.obj.data.SMask.data).toMatchObject({
BitsPerComponent: 8,
ColorSpace: 'DeviceGray',
Decode: [0, 1],
Filter: 'FlateDecode',
Height: 32,
Length: 16,
Subtype: 'Image',
Type: 'XObject',
Width: 32,
});
});

test('Grayscale', () => {
Expand Down