PeachImage

PeachImage.ImageDecoder

ImageDecoder.TryDecodeInto(ReadOnlySpan<byte>, Span<byte>, ImageInfo, ImageMetadata, int) Method

Like DecodeInto(ReadOnlySpan<byte>, Span<byte>, ImageMetadata, int), but returns false instead of throwing when destination is too small. Nothing is decoded then, info is the header’s own description (so info.GetRequiredBufferSize(options, rowStride) gives the size needed) and metadata is empty. A damaged or unsupported image still throws.

public bool TryDecodeInto(System.ReadOnlySpan<byte> data, System.Span<byte> destination, out PeachImage.ImageInfo info, out PeachImage.ImageMetadata metadata, int rowStride=0);

Parameters

data System.ReadOnlySpan<System.Byte>

destination System.Span<System.Byte>

info ImageInfo

metadata ImageMetadata

rowStride System.Int32

Returns

System.Boolean