diff --git a/CHANGELOG.md b/CHANGELOG.md index 829c10d7e..5a5b4e9cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/DocMeasure.js b/src/DocMeasure.js index 69613b015..79eeebbcf 100644 --- a/src/DocMeasure.js +++ b/src/DocMeasure.js @@ -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);