Table of Contents

Method TryRead

Namespace
MailFathom.Application.Emails.Extraction.Images
Assembly
MailFathom.Application.dll

TryRead(ReadOnlySpan<byte>, out ImageAttachmentHeader?, out ImageDescriptionRefusal)

Reads what the octets declare themselves to be, or names why they will not be described.

public static bool TryRead(ReadOnlySpan<byte> content, out ImageAttachmentHeader? header, out ImageDescriptionRefusal refusal)

Parameters

content ReadOnlySpan<byte>

The attachment's decoded octets, whole.

header ImageAttachmentHeader

What the octets declare, when they declare a supported format readably.

refusal ImageDescriptionRefusal

Why no header was read, meaningful only when this returns false.

Returns

bool

true when a header was read, false when the octets are refused.

Remarks

A markup document is separated from an unrecognized format before any signature is tried, because the two are refused for different reasons and an SVG arriving as an unrecognized format would say nothing about why it will never be admitted.