Interface IImageFormatDetector
Used for detecting mime types from a file header
Namespace: SixLabors.ImageSharp.Formats
Assembly: SixLabors.ImageSharp.dll
Syntax
public interface IImageFormatDetector
Properties
| Edit this page View SourceHeaderSize
Gets the size of the header for this image type.
Declaration
int HeaderSize { get; }
Property Value
Type | Description |
---|---|
int | The size of the header. |
Methods
| Edit this page View SourceTryDetectFormat(ReadOnlySpan<byte>, out IImageFormat?)
Detect mimetype
Declaration
bool TryDetectFormat(ReadOnlySpan<byte> header, out IImageFormat? format)
Parameters
Type | Name | Description |
---|---|---|
ReadOnlySpan<byte> | header | The byte[] containing the file header. |
IImageFormat | format | The mime type of detected otherwise returns null |
Returns
Type | Description |
---|---|
bool | returns true when format was detected otherwise false. |