having problem in getting image orientation with below code
string fileName = @\"D:\\...\\...\\01012015004435.jpeg\";
int rotate = 0;
using (var
Use the following:
img.PropertyIdList.Contains(orientationId)
to check if the Exif tag is present.img.GetPropertyItem(orientationId)
to get it (after the above check, otherwise you'll get an ArgumentException
).img.SetPropertyItem(pItem)
to set it.I wrote a simple helper class that does all that: you can check the full source code here.
Other info and a quick case-study is also available on the following post on my blog:
Change image orientation for iPhone and/or Android pics in NET C#