API Reference
OfficeImageReader
Bounded image metadata reader used to avoid full image decoding dependencies.
Inheritance
- Object
- OfficeImageReader
Methods
public static OfficeImageFormat FromExtension(String fileName) #OfficeImageFormatMaps a file name or extension to a supported image format.
Parameters
- fileName System.String
public static OfficeImageInfo Identify(String filePath) #OfficeImageInfoIdentifies image metadata from a file.
Parameters
- filePath System.String
public static OfficeImageInfo Identify(Byte[] data, String fileName = null) #OfficeImageInfoIdentifies image metadata from a byte array.
Parameters
- data System.Byte[]
- fileName System.String = null
public static Boolean IsKnownImageExtension(String fileName) #BooleanReturns whether the file name or extension maps to an image format known by the shared drawing layer.
Parameters
- fileName System.String
- File name, path, or bare extension.
Returns
true when the extension maps to a known image format.
public static Boolean TryIdentify(Stream stream, String fileName, out OfficeImageInfo info) #BooleanTries to identify image metadata from a stream.
Parameters
- stream System.IO.Stream
- fileName System.String
- info OfficeIMO.Drawing.OfficeImageInfo@
public static Boolean TryIdentify(Byte[] data, String fileName, out OfficeImageInfo info) #BooleanTries to identify image metadata from a byte array.
Parameters
- data System.Byte[]
- fileName System.String
- info OfficeIMO.Drawing.OfficeImageInfo@
public static Boolean TryIdentifyByContent(Stream stream, String fileName, out OfficeImageInfo info) #BooleanTries to identify image metadata from a stream while requiring the content to match a supported format. The file name may select a content parser but cannot identify the image by extension alone.
Parameters
- stream System.IO.Stream
- fileName System.String
- info OfficeIMO.Drawing.OfficeImageInfo@
public static Boolean TryIdentifyByContent(Byte[] data, String fileName, out OfficeImageInfo info) #BooleanTries to identify image metadata from a byte array while requiring the content to match a supported format. The file name may select a content parser but cannot identify the image by extension alone.
Parameters
- data System.Byte[]
- fileName System.String
- info OfficeIMO.Drawing.OfficeImageInfo@
public static Boolean TryValidateContent(Stream stream, String fileName, out OfficeImageInfo info) #BooleanValidates a complete bounded image payload and returns its metadata. Unlike metadata identification, this decodes supported PNG, JPEG, GIF, BMP, TIFF, and WebP payloads and validates every ICO entry so structurally plausible but incomplete image bodies are rejected.
Parameters
- stream System.IO.Stream
- fileName System.String
- info OfficeIMO.Drawing.OfficeImageInfo@
public static Boolean TryValidateContent(Stream stream, String fileName, CancellationToken cancellationToken, out OfficeImageInfo info) #BooleanValidates a complete bounded image payload and observes cancellation while reading, parsing, and decoding the payload.
Parameters
- stream System.IO.Stream
- fileName System.String
- cancellationToken System.Threading.CancellationToken
- info OfficeIMO.Drawing.OfficeImageInfo@
public static Boolean TryValidateContent(Byte[] data, String fileName, out OfficeImageInfo info) #BooleanValidates a complete bounded image payload and returns its metadata. Unlike metadata identification, this decodes supported PNG, JPEG, GIF, BMP, TIFF, and WebP payloads and validates every ICO entry so structurally plausible but incomplete image bodies are rejected.
Parameters
- data System.Byte[]
- fileName System.String
- info OfficeIMO.Drawing.OfficeImageInfo@
public static Boolean TryValidateContent(Byte[] data, String fileName, CancellationToken cancellationToken, out OfficeImageInfo info) #BooleanValidates a complete bounded image payload and observes cancellation while parsing and decoding it.
Parameters
- data System.Byte[]
- fileName System.String
- cancellationToken System.Threading.CancellationToken
- info OfficeIMO.Drawing.OfficeImageInfo@
Inherited Methods
public override Boolean Equals(Object obj) #BooleanParameters
- obj Object