Class ImageFileInfo
Represents basic information about an image container.
Inheritance
Namespace: PhotoSauce.MagicScaler
Assembly: PhotoSauce.MagicScaler.dll
Syntax
public sealed class ImageFileInfo : Object
Constructors
ImageFileInfo(Int32, Int32)
Constructs a new ImageFileInfo instance with a single frame of the specified width
and height
.
Declaration
public ImageFileInfo(int width, int height)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | width | The width of the image frame in pixels. |
System.Int32 | height | The height of the image frame in pixels. |
ImageFileInfo(String, IReadOnlyList<ImageFileInfo.FrameInfo>, Int64, DateTime)
Constructs a new ImageFileInfo instance the specified values.
Declaration
public ImageFileInfo(string mimeType, IReadOnlyList<ImageFileInfo.FrameInfo> frames, long fileSize, DateTime fileDate)
Parameters
Type | Name | Description |
---|---|---|
System.String | mimeType | The MIME type of the image container. |
System.Collections.Generic.IReadOnlyList<ImageFileInfo.FrameInfo> | frames | A list containing one ImageFileInfo.FrameInfo per image frame in the container. |
System.Int64 | fileSize | The size in bytes of the image file. |
System.DateTime | fileDate | The last modified date of the image file. |
Properties
FileDate
The last modified date of the image container, if applicable.
Declaration
public DateTime FileDate { get; }
Property Value
Type | Description |
---|---|
System.DateTime |
FileSize
The size of the image container in bytes.
Declaration
public long FileSize { get; }
Property Value
Type | Description |
---|---|
System.Int64 |
Frames
One or more ImageFileInfo.FrameInfo instances describing each image frame in the container.
Declaration
public IReadOnlyList<ImageFileInfo.FrameInfo> Frames { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<ImageFileInfo.FrameInfo> |
MimeType
The MIME type of the image container.
Declaration
public string MimeType { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
Load(Stream)
Constructs a new ImageFileInfo instance by reading the metadata from an image file exposed by a System.IO.Stream.
Declaration
public static ImageFileInfo Load(Stream imgStream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | imgStream | The stream containing the image data. |
Returns
Type | Description |
---|---|
ImageFileInfo |
Load(Stream, DateTime)
Constructs a new ImageFileInfo instance by reading the metadata from an image file exposed by a System.IO.Stream.
Declaration
public static ImageFileInfo Load(Stream imgStream, DateTime lastModified)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | imgStream | The stream containing the image data. |
System.DateTime | lastModified | The last modified date of the image container. |
Returns
Type | Description |
---|---|
ImageFileInfo |
Load(ReadOnlySpan<Byte>)
Constructs a new ImageFileInfo instance by reading the metadata from an image file contained in a System.ReadOnlySpan<>.
Declaration
public static ImageFileInfo Load(ReadOnlySpan<byte> imgBuffer)
Parameters
Type | Name | Description |
---|---|---|
System.ReadOnlySpan<System.Byte> | imgBuffer | The buffer containing the image data. |
Returns
Type | Description |
---|---|
ImageFileInfo |
Load(ReadOnlySpan<Byte>, DateTime)
Constructs a new ImageFileInfo instance by reading the metadata from an image file contained in a System.ReadOnlySpan<>.
Declaration
public static ImageFileInfo Load(ReadOnlySpan<byte> imgBuffer, DateTime lastModified)
Parameters
Type | Name | Description |
---|---|---|
System.ReadOnlySpan<System.Byte> | imgBuffer | The buffer containing the image data. |
System.DateTime | lastModified | The last modified date of the image container. |
Returns
Type | Description |
---|---|
ImageFileInfo |
Load(String)
Constructs a new ImageFileInfo instance by reading the metadata from an image file header.
Declaration
public static ImageFileInfo Load(string imgPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | imgPath | The path to the image file. |
Returns
Type | Description |
---|---|
ImageFileInfo |