Quantcast
Channel: User Simon_Weaver - Stack Overflow
Viewing all articles
Browse latest Browse all 116

How do I reliably get an image dimensions in .NET without loading the image?

$
0
0

I know how to get the size (x,y) of an image

Image.FromFile("cat.jpg").Size

BUT that requires loading the image from memory.

When I view the images in Windows Explorer it shows me the size.

  • How do I access that size?
  • Is it reliable for all images? Does Windows explorer need to have 'seen' the image first for that size to be available. I don't want to upload my images to a server and have no metadata available if I never opened the folder.

Viewing all articles
Browse latest Browse all 116

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>