May 25, 2013   Login   |   Register  
  Search  
  |  
  Home | Blog
  Home
  About
  Blog
  Contact
  Products
  Support
  Forums
  Buy Now
  Downloads

The Renegade Blog

Minimize
 Print   

The Renegade Blog

Minimize
 Print   

The Renegade Blog

Minimize
By Renegade on Friday, December 24, 2010 11:37 PM

Well, I've been having some mysterious problems finding out image orientations as they simply seem to disappear.

Image orientation is contained in EXIF meta data and can be gotten through the Image.PropertyItems property of an Image.

However, when dealing with an image, Windows places a lock on the file, making things rather inconvenient. As such, you need to clone or copy the image then dispose of the Image something like this:

img.Dispose();
img = null;

For slower computers or limited memory you'd also want to do garbage collection with GC.Collect().

However, once you do that, the image orientation EXIF information is no longer available. It just disappears.

So, to get the orientation you must leave the file locked, get the information like this:

PropertyItem propItem = image.GetPropertyItem(274);
ushort orientation = propItem.Value;&l ... Read More »

 Print   

The Renegade Blog

Minimize
 Print   

Tweets

Minimize
 Print   
     
Renegade Minds About | Blog | Contact

  Search

Copyright 2012 by Renegade Minds   |   Privacy Statement   |   Terms of Use
Renegade Minds