Class FileInspector
- Namespace
- LMKit.Inspection
- Assembly
- LM-Kit.NET.dll
Universal file metadata inspection: identifies ANY file from its leading magic bytes and extracts its metadata - image EXIF/GPS, video and audio stream summaries, PDF and Office document properties - into one stable FileInspection envelope.
Fast by construction: extractors perform bounded, header-only reads (chunk and box walks, targeted seeks), never a full decode - inspecting a multi-gigabyte video touches kilobytes. Every image format is parsed by the native imaging library (the same per-format parsers the codecs use), which probes headers and metadata without decoding pixels. PDF is routed through the SDK's existing pdfium metadata surface (PdfInfo).
Never throws on content: an unrecognized format still yields the identity layer, and malformed files yield whatever was readable plus Warnings. Only null arguments throw.
FileInspection info = FileInspector.Inspect(File.ReadAllBytes("photo.jpg"), "photo.jpg");
Console.WriteLine($"{info.Format} {info.Image?.Width}x{info.Image?.Height}");
foreach (MetadataProperty p in info.Properties)
Console.WriteLine($"[{p.Group}] {p.Key} = {p.Value}");
public static class FileInspector
- Inheritance
-
FileInspector
- Inherited Members
Methods
- Inspect(Attachment)
Inspects an Attachment (the SDK's common input abstraction).
- Inspect(byte[], string)
Inspects in-memory content.
fileNameis optional and used only as an identification fallback for signature-less formats.
- Inspect(Stream, string)
Inspects a stream. A seekable stream is read in place with bounded, targeted reads; a non-seekable stream is buffered first.
- Inspect(string)
Inspects a file on disk.