Skip to content

Commit 8bead5d

Browse files
committed
Fix thumbnail cropping issue when EXIF orientation metadata is missing
Fix #76
1 parent 08f254f commit 8bead5d

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGES.md

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ Version 0.3.3
66

77
To be released.
88

9+
- Fixed a bug where generated thumbnails had been cropped incorrectly
10+
if the original image had not the EXIF orientation metadata. [[#76]]
11+
912

1013
Version 0.3.2
1114
-------------

src/media.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ export async function uploadThumbnail(
2424
const originalMetadata = await original.metadata();
2525
let width = originalMetadata.width!;
2626
let height = originalMetadata.height!;
27-
if (originalMetadata.orientation !== 1) {
27+
if (
28+
originalMetadata.orientation != null &&
29+
originalMetadata.orientation !== 1
30+
) {
2831
// biome-ignore lint/style/noParameterAssign:
2932
original = original.clone();
3033
original.rotate();

0 commit comments

Comments
 (0)