We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 804022e commit 4e52dfbCopy full SHA for 4e52dfb
1 file changed
lib/image.js
@@ -28,7 +28,12 @@ class PDFImage {
28
29
if (data[0] === 0xff && data[1] === 0xd8) {
30
return new JPEG(data, label);
31
- } else if (data[0] === 0x89 && data.toString('ascii', 1, 4) === 'PNG') {
+ } else if (
32
+ data[0] === 0x89 &&
33
+ data[1] === 0x50 &&
34
+ data[2] === 0x4e &&
35
+ data[3] === 0x47
36
+ ) {
37
return new PNG(data, label);
38
} else {
39
throw new Error('Unknown image format.');
0 commit comments