foreach (var prop in img.PropertyItems) { if (prop.Id == 0x0112) //value of EXIF { var orientation = img.GetPropertyItem(prop.Id).Value[0]; switch (orientation) { case 1: // No rotation required. break; case 2: img.RotateFlip(RotateFlipType.RotateNoneFlipX); break; case 3: img.RotateFlip(RotateFlipType.Rotate180FlipNone);
foreach (var prop in img.PropertyItems) { if (prop.Id == 0x0112) //value of EXIF { var orientation = prop.Value; if (orientation == 3) { prop.Value[0] = 1; img.SetPropertyItem(prop); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)