Class PngImageFormatDetector
Detects png file headers
Implements
Namespace: SixLabors.ImageSharp.Formats.Png
Assembly: SixLabors.ImageSharp.dll
Syntax
public sealed class PngImageFormatDetector : object, IImageFormatDetector
Properties
| Improve this Doc View SourceHeaderSize
Gets the size of the header for this image type.
Declaration
public 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
public 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. |