+ /**
+ * @return rotation required to display photo properly (0 to 3)
+ */
+ public int getRequiredRotation()
+ {
+ if (_orientationCode <= 2) { return 0; } // no rotation required
+ if (_orientationCode <= 4) { return 2; } // 180 degrees
+ if (_orientationCode <= 6) { return 1; } // 270 degrees, so need to rotate by 90
+ return 3; // 90 degrees, so need to rotate by 270
+ }
+