Skip to content

Commit 98558fd

Browse files
committed
fixed a potential issue in the minimized library when detecting the orientation of JPEG images #2827
1 parent bfe7fd3 commit 98558fd

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
- Fixed a potential issue in the minimized library when detecting the orientation of JPEG images
6+
37
## 0.2.17 - 2024-12-23
48

59
- Fix big size pdfmake bundle for browser

src/imageMeasure.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,9 @@ ImageMeasure.prototype.measureImage = function (src) {
2828

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

31-
if (typeof image === 'object' && image.constructor.name === 'JPEG') {
32-
// If EXIF orientation calls for it, swap width and height
33-
if (image.orientation > 4) {
34-
imageSize = { width: image.height, height: image.width };
35-
}
31+
// If EXIF orientation calls for it, swap width and height
32+
if (image.orientation > 4) {
33+
imageSize = { width: image.height, height: image.width };
3634
}
3735

3836
return imageSize;

0 commit comments

Comments
 (0)