- if (orientation == EV_ORIENTATION_PORTRAIT ||
- orientation == EV_ORIENTATION_UPSIDEDOWN) {
- if (width)
- *width = (int) ((*width) * scale + 0.5);
- if (height)
- *height = (int) ((*height) * scale + 0.5);
+ w = (int) (w * scale + 0.5);
+ h = (int) (h * scale + 0.5);
+
+ if (rotation == 0 || rotation == 180) {
+ if (width) *width = w;
+ if (height) *height = h;