Skip to content

@react-pdf/png-js doesn't support Adam 7 interlacing #676

Description

@fluke

Describe the bug
Using PNGs with Adam 7 interlacing throws the error Invalid filter which we've seen before in #391

To Reproduce
I'm attaching an interlaced and non interlaced image. Using the interlaced image throws the above error.

const InterlacedPngPdf = () => (
  <Document>
    <Page>
      <Image
        src="https://i.imgur.com/wNI68lf.png"
      />
    </Page>
  </Document>
);

ReactPDF.render(<InterlacedPngPdf />);

Image - Noninterlaced

Exif data:

ExifTool Version Number : 11.60
File Name : BikeaidSG logo - photopea.png
Directory : .
File Size : 11 kB
File Modification Date/Time : 2019:08:04 09:31:45+05:30
File Access Date/Time : 2019:08:04 10:19:10+05:30
File Inode Change Date/Time : 2019:08:04 09:31:53+05:30
File Permissions : rw-r--r--
File Type : PNG
File Type Extension : png
MIME Type : image/png
Image Width : 1280
Image Height : 720
Bit Depth : 8
Color Type : Palette
Compression : Deflate/Inflate
Filter : Adaptive
Interlace : Noninterlaced
SRGB Rendering : Relative Colorimetric
Pixels Per Unit X : 3780
Pixels Per Unit Y : 3780
Pixel Units : meters
Palette : (Binary data 132 bytes, use -b option to extract)
Image Size : 1280x720
Megapixels : 0.922

Image - Adam 7 interlacing

Exif data:

ExifTool Version Number : 11.60
File Name : BikeaidSG logo.png
Directory : .
File Size : 17 kB
File Modification Date/Time : 2019:08:04 09:31:05+05:30
File Access Date/Time : 2019:08:04 10:19:53+05:30
File Inode Change Date/Time : 2019:08:04 09:31:10+05:30
File Permissions : rw-r--r--
File Type : PNG
File Type Extension : png
MIME Type : image/png
Image Width : 1280
Image Height : 720
Bit Depth : 8
Color Type : Palette
Compression : Deflate/Inflate
Filter : Adaptive
Interlace : Adam7 Interlace
SRGB Rendering : Perceptual
Gamma : 2.2
Palette : (Binary data 219 bytes, use -b option to extract)
Transparency : (Binary data 73 bytes, use -b option to extract)
Pixels Per Unit X : 3779
Pixels Per Unit Y : 3779
Pixel Units : meters
Image Size : 1280x720
Megapixels : 0.922

Expected behavior
The PNG should render.

Desktop (please complete the following information):

  • OS: [e.g. MacOS, Windows] MacOS
  • Browser [e.g. chrome, safari] chrome
  • React-pdf version [e.g. v1.1.0] 1.6.2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions