Пример #1
0
            /// <summary>
            /// Searches metadata in image
            /// </summary>
            public static void SearchMetadata(string filePath, string propertyName, SearchCondition searchCondition)
            {
                try
                {
                    //ExStart:ImageSearchAPI
                    filePath = Common.MapSourceFilePath(filePath);

                    TiffTag[] resolutionTags = SearchFacade.ScanExifTags(filePath, new Regex("^(XResolution|YResolution)$"));

                    foreach (TiffTag resolutionTag in resolutionTags)
                    {
                        Console.WriteLine("{0} - {1}", resolutionTag.DefinedTag, ((TiffRationalTag)resolutionTag).TagValue[0].Value);
                    }
                    //ExEnd:ImageSearchAPI
                }
                catch (Exception exp)
                {
                    Console.WriteLine("Exception occurred: " + exp.Message);
                }
            }