Skip to content

Instantly share code, notes, and snippets.

@dejanstojanovic
Created February 18, 2015 15:06
Show Gist options
  • Save dejanstojanovic/c5df7310174b570c16bc to your computer and use it in GitHub Desktop.
Save dejanstojanovic/c5df7310174b570c16bc to your computer and use it in GitHub Desktop.
Fast and short way to get image size in C#
using(var img = Image.FromFile(file.Name))
{
var height = img.Height;
var width = img.Width;
}
@MikeJPelton
Copy link

Huge performance improvement over the first option - thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment