Class ImageHeader
Taken from http://stackoverflow.com/questions/111345/getting-image-dimensions-without-reading-the-entire-file/111349 Minor improvements including supporting unsigned 16-bit integers when decoding Jfif and added logic to load the image using new Bitmap if reading the headers fails.
Inheritance
System.Object
ImageHeader
Namespace: DotNetNuke.Web.InternalServices
Assembly: DotNetNuke.Web.dll
Syntax
public static class ImageHeader : object
Methods
| Improve this Doc View SourceGetDimensions(BinaryReader)
Gets the dimensions of an image.
Declaration
public static Size GetDimensions(BinaryReader binaryReader)
Parameters
| Type | Name | Description |
|---|---|---|
| BinaryReader | binaryReader | The path of the image to get the dimensions of. |
Returns
| Type | Description |
|---|---|
| Size | The dimensions of the specified image. |
GetDimensions(String)
Gets the dimensions of an image.
Declaration
public static Size GetDimensions(string path)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | path | The path of the image to get the dimensions of. |
Returns
| Type | Description |
|---|---|
| Size | The dimensions of the specified image. |