Class FormPictures
- Namespace
- RDCore.Forms.Model
- Assembly
- RDCore.Forms.dll
Reads what a picture's header says about it before anything decodes it, and refuses a picture too large or too malformed to decode safely, as error 481.
public static class FormPictures
- Inheritance
-
FormPictures
- Inherited Members
Remarks
The header is read by TryRead(ReadOnlySpan<byte>, out PictureInfo), which checks every offset against the bytes and never throws; its remarks list what it refuses, and its RDCore.SDK.Workspace.Pictures.PictureHeader.MaxBytes, RDCore.SDK.Workspace.Pictures.PictureHeader.MaxSide and RDCore.SDK.Workspace.Pictures.PictureHeader.MaxPixels are the bounds. A refused picture is error 481, "Invalid picture", as InvalidPicture.
Methods
Inspect(byte[]?, out PictureInfo)
Reads a picture's header.
public static FormError? Inspect(byte[]? bytes, out PictureInfo info)
Parameters
bytesbyte[]The picture, as its file holds it.
infoPictureInfoWhat the header says: set when the picture is accepted, default otherwise.
Returns
- FormError?
null when the picture is accepted; otherwise InvalidPicture, for no bytes or a picture that TryRead(ReadOnlySpan<byte>, out PictureInfo) refuses.