I want to write some tests to verify that an IValueConverter rotates an image according to it's EXIF Metadata for orientation.
I've created a test image which is 400px wide and 300px high, the top half of which is white and the lower half is black.
If I can examine the colours of the pixels in the corners of the image then I can write my tests and make assertions according to the following table:
Orientation Top Left Top Right Bottom Left Bottom Right Landscape White White Black Black Portrait Clockwise Black White Black White Portrait Anti Clockwise White Black White Black
(I am not expecting images to be upside-down or reflected either horizontally or vertically)
using(var f = new FileStream(@"C:\test.jpg",FileMode.Open, FileAccess.Read))
{
var bitmapFrame = BitmapFrame.Create(f);
}
How can I access the corner pixels and examine whether they are black or white?