Constructor ImageAttachmentHeader
- Namespace
- MailFathom.Application.Emails.Extraction.Images
- Assembly
- MailFathom.Application.dll
ImageAttachmentHeader(ImageAttachmentFormat, int, int)
What an image's own header says it is and how large a grid it declares.
public ImageAttachmentHeader(ImageAttachmentFormat Format, int Width, int Height)
Parameters
FormatImageAttachmentFormatThe format the octets are in, decided from the octets rather than from any declared media type.
WidthintThe declared width in pixels.
HeightintThe declared height in pixels.
Remarks
This is a read of a few octets and never a decode. Nothing here allocates for a pixel grid, expands a compressed stream, or hands the octets to a codec, which is what makes it safe to run on an attachment a stranger composed: a file declaring a grid of billions of pixels costs the same few comparisons as one declaring a thumbnail, and it is refused on the declaration rather than on the allocation the declaration would have caused.
The grid is what the file declares. Nothing here proves the compressed data behind it matches, because proving that is the decode this exists to avoid; a file whose header understates its content is refused by whatever decodes it next, having never been sent under a bound this deployment believed.