This is my final problem and I will leave you guys alone. I really need tiff tag support to get the orientation. We have been doing debug and testing on the project prior to distribution in the field. I have left a few of our big customers look at our new product and they all have said the same thing, why are half the images upside down. I will forego the bitmapstate if we can fix the tiff tag support. I trying to be difficult I just need some options that I am sure are in your other products. It would be hard to have a winform control in these days that did not get the orientation correct. I appreciate you help so far and hope that I you will be able to add tiff tag support.
Graphics Mill for .NET doesn't support arbitrary TIFF tags, but it supports EXIF and IPTC meta information. Support of arbitrary tags will be implemented in future versions of the library. Orientation TIFF tag is included to EXIF meta information. So you can obtain the value via EXIF dictionary collection. See the following code snippet:
The values can be interpreted as following: 1 = The 0th row represents the visual top of the image, and the 0th column represents the visual left-hand side. 2 = The 0th row represents the visual top of the image, and the 0th column represents the visual right-hand side. 3 = The 0th row represents the visual bottom of the image, and the 0th column represents the visual right-hand side. 4 = The 0th row represents the visual bottom of the image, and the 0th column represents the visual left-hand side. 5 = The 0th row represents the visual left-hand side of the image, and the 0th column represents the visual top. 6 = The 0th row represents the visual right-hand side of the image, and the 0th column represents the visual top. 7 = The 0th row represents the visual right-hand side of the image, and the 0th column represents the visual bottom. 8 = The 0th row represents the visual left-hand side of the image, and the 0th column.
For detailed information about EXIF and IPTC see here.
Wow that is great it works like a dream. I sent you a few images that I said that loaded slow they are a little slower now but they are oriented right. Can you make sure that I am doing this correctly and if it is the most efficient?
System.UInt32 orientation = 1; Aurigma.GraphicsMill.Codecs.TiffReader
reader = new Aurigma.GraphicsMill.Codecs.TiffReader(filePath);
if (reader.Exif != null)
{
orientation = (System.UInt32)reader.Exif[Aurigma.GraphicsMill.Codecs.ExifDictionary.Orientation];
}
BitmapViewer1.Bitmap.Load(filePath);
if (orientation == 3)
{
BitmapViewer1.Bitmap.Transforms.RotateAndFlip(System.Drawing.RotateFlipType.Rotate180FlipNone);
}
You have been a tremendous help and I appreciate you guys coming thru for me. I hate to be such a pest and I just want to let you know that this is great. I really appreciate all your help.