Skip to content

Commit

Permalink
fixed a potential issue in the minimized library when detecting the o…
Browse files Browse the repository at this point in the history
…rientation of JPEG images #2827
  • Loading branch information
liborm85 committed Dec 31, 2024
1 parent 5926fc9 commit 3b6ec28
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Reverted to the original `pdfkit` package, moving away from `@foliojs-fork`
- Update pdfkit to 0.16.0
- Fixed a potential issue in the minimized library when detecting the orientation of JPEG images

## 0.3.0-beta.14 - 2024-12-23

Expand Down
8 changes: 3 additions & 5 deletions src/DocMeasure.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,9 @@ class DocMeasure {

let imageSize = { width: image.width, height: image.height };

if (image.constructor.name === 'JPEG') {
// If EXIF orientation calls for it, swap width and height
if (image.orientation > 4) {
imageSize = { width: image.height, height: image.width };
}
// If EXIF orientation calls for it, swap width and height
if (image.orientation > 4) {
imageSize = { width: image.height, height: image.width };
}

this.measureImageWithDimensions(node, imageSize);
Expand Down

0 comments on commit 3b6ec28

Please sign in to comment.