0
votes

I have an image viewer written in C#, WPF, .NET v4. It reads the orientation EXIF tag and rotates accordingly the displayed image. It works great for JPGs. When loading RAW formats supported by the camera codec pack (NEF and CR2, in my case) the rotation is correct only for 0 and 180 degrees, for 90 and 270 the image is rotated by 180 degree (ie. upside-down, not portrait). The code for rotation is (imgOrientation below is correct):

img.LayoutTransform = new RotateTransform(imgOrientation);

Windows Photo Viewer shows OK.

Is somebody aware of this problem, any solution?

Thanks.

1

1 Answers

-1
votes

Sounds to me like the direction of the rotation angle used by NEF and CR2 is opposite of what is expected by RotateTransform. Perhaps you could try to send in 360 - imgOrientation instead of just imgOrientation?