using (FileStream fsImage = new FileStream ("Homer.jpg", FileMode.Open, FileAccess.Read))
{
ImageInfo imageInfo = new ImageInfo ();
imageInfo.SetInput (fsImage);
imageInfo.CollectComments = true;
imageInfo.DetermineNumberOfImages = true;
if (imageInfo.Check ())
{
Console.WriteLine ("File Format: {0}", imageInfo.Format);
Console.WriteLine ("MIME Type: {0}", imageInfo.GetMimeType ());
Console.WriteLine ("Width (pixels): {0}", imageInfo.Width);
Console.WriteLine ("Height (pixels): {0}", imageInfo.Height);
Console.WriteLine ("Bits per pixel: {0}", imageInfo.BitsPerPixel);
Console.WriteLine ("Progressive: {0}", imageInfo.IsProgressive);
Console.WriteLine ("Number of images: {0}", imageInfo.NumberOfImages);
Console.WriteLine ("Physical width (dpi): {0}", imageInfo.PhysicalWidthDpi);
Console.WriteLine ("Physical height (dpi): {0}", imageInfo.PhysicalHeightDpi);
Console.WriteLine ("Physical width (inches): {0}", imageInfo.PhysicalWidthInch);
Console.WriteLine ("Physical height (inches): {0}", imageInfo.PhysicalHeightInch);
Console.WriteLine ("Number of textual comments: {0}", imageInfo.NumberOfComments);
for (Int32 ixComment = 0; ixComment < imageInfo.NumberOfComments; ixComment++)
{
Console.WriteLine ("\t{0}", imageInfo.GetComment (ixComment));
}
}
}