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 bfe7fd3 commit 98558fd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Unreleased

- Fixed a potential issue in the minimized library when detecting the orientation of JPEG images

## 0.2.17 - 2024-12-23

- Fix big size pdfmake bundle for browser
Expand Down
8 changes: 3 additions & 5 deletions src/imageMeasure.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,9 @@ ImageMeasure.prototype.measureImage = function (src) {

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

if (typeof image === 'object' && 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 };
}

return imageSize;
Expand Down

0 comments on commit 98558fd

Please sign in to comment.