Interface IImageFormatDetector
Used for detecting mime types from a file header
Namespace: SixLabors.ImageSharp.Formats
Assembly: SixLabors.ImageSharp.dll
Syntax
public interface IImageFormatDetector
Properties
| Improve this Doc View SourceHeaderSize
Gets the size of the header for this image type.
Declaration
int HeaderSize { get; }
Property Value
Type | Description |
---|---|
Int32 | The size of the header. |
Methods
| Improve this Doc 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 |
---|---|
Boolean | returns true when format was detected otherwise false. |