Skip to content

Commit

Permalink
fpdf: handle 16-bit depth PNG files
Browse files Browse the repository at this point in the history
Fixes #49.

Signed-off-by: Sebastien Binet <[email protected]>
  • Loading branch information
sbinet committed Sep 13, 2023
1 parent 483de46 commit 504c6dd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion png.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ func (f *Fpdf) parsepngstream(r *rbuffer, readdpi bool) (info *ImageInfoType) {
h := r.i32()
bpc := r.u8()
if bpc > 8 {
f.err = fmt.Errorf("16-bit depth not supported in PNG file")
if f.pdfVersion < pdfVers1_5 {
f.pdfVersion = pdfVers1_5
}
}
ct := r.u8()
var colspace string
Expand Down

0 comments on commit 504c6dd

Please sign in to comment.