Skip to content

Commit 3b6ec28

Browse files
committed
fixed a potential issue in the minimized library when detecting the orientation of JPEG images #2827
1 parent 5926fc9 commit 3b6ec28

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

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

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

src/DocMeasure.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,9 @@ class DocMeasure {
131131

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

134-
if (image.constructor.name === 'JPEG') {
135-
// If EXIF orientation calls for it, swap width and height
136-
if (image.orientation > 4) {
137-
imageSize = { width: image.height, height: image.width };
138-
}
134+
// If EXIF orientation calls for it, swap width and height
135+
if (image.orientation > 4) {
136+
imageSize = { width: image.height, height: image.width };
139137
}
140138

141139
this.measureImageWithDimensions(node, imageSize);

0 commit comments

Comments
 (0)