Skip to content

Commit

Permalink
fix: jpeg precision metadata (diegomura#2689)
Browse files Browse the repository at this point in the history
* fix: fixed this.bits undefined causing jpegs to not render in some viewers

* chore: add changeset

---------

Co-authored-by: Diego Muracciole <diegomuracciole@gmail.com>
  • Loading branch information
joelybahh and diegomura committed Mar 26, 2024
1 parent 6ffd1b9 commit e2d21a4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/wicked-jeans-switch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@react-pdf/pdfkit": patch
---

fix: jpeg precision metadata
1 change: 1 addition & 0 deletions packages/pdfkit/src/image/jpeg.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class JPEG {
}

if (marker.name === 'SOF') {
this.bits ||= marker.precision;
this.width ||= marker.width;
this.height ||= marker.height;
this.colorSpace ||= COLOR_SPACE_MAP[marker.numberOfComponents];
Expand Down

0 comments on commit e2d21a4

Please sign in to comment.