Skip to content

Commit 5b56865

Browse files
steffahnqu1ck
authored andcommitted
Also add support for exif data about mirrored images
1 parent 767c072 commit 5b56865

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

main.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,20 @@ class rotatingJPEGHandler : public wxJPEGHandler
6262
switch (result.Orientation)
6363
{
6464
case 1:
65+
case 2:
6566
// unrotated image
6667
break;
6768
case 3:
69+
case 4:
6870
// 180 deg off
6971
*image = image->Rotate180();
7072
break;
73+
case 5:
7174
case 6:
7275
// needs correction 90 deg clockwise
7376
*image = image->Rotate90(true);
7477
break;
78+
case 7:
7579
case 8:
7680
// needs correction 90 deg counterclockw
7781
*image = image->Rotate90(false);
@@ -80,6 +84,19 @@ class rotatingJPEGHandler : public wxJPEGHandler
8084
// unknown rotation
8185
break;
8286
}
87+
switch (result.Orientation)
88+
{
89+
case 2:
90+
case 4:
91+
case 5:
92+
case 7:
93+
// in these cases, the image was (also) mirrored
94+
*image = image->Mirror();
95+
break;
96+
default:
97+
// not mirrored (or unknown)
98+
break;
99+
}
83100

84101
return true;
85102
}

0 commit comments

Comments
 (0)