←Select platform

MetadataItemsSupported Method

Summary
Checks whether the specified file format supports metadata.
Syntax
C#
C++/CLI
Python
public static bool MetadataItemsSupported( 
   RasterImageFormat format 
) 
public: 
static bool MetadataItemsSupported(  
   RasterImageFormat format 
)  
def MetadataItemsSupported(self,format): 

Parameters

format
The RasterImageFormat to check.

Return Value

true if the specified file format supports metadata, otherwise false.

Example
C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing; 
using Leadtools.ImageProcessing.Color; 
using Leadtools.Svg; 
 
 
public void ReadMetadataItemsExample() 
{ 
   // The source file 
   string srcFileName = Path.Combine(LEAD_VARS.ImagesDir, "random.dxf"); 
 
   using (var codecs = new RasterCodecs()) 
   { 
      bool isMetadataItemsSupported; 
 
      using (var fileInfo = codecs.GetInformation(srcFileName, false)) 
      { 
         Debug.WriteLine("Format {0}", (int)fileInfo.Format); 
         //Check if Metadata supported for the specified file format. 
         isMetadataItemsSupported = RasterCodecs.MetadataItemsSupported(fileInfo.Format); 
         Debug.WriteLine("isMetadataItemsSupported {0}", isMetadataItemsSupported); 
      } 
 
      if (isMetadataItemsSupported) 
      { 
         IDictionary<string, string> metadata = null; 
 
         try 
         { 
            //Read Metadata Items 
            metadata = codecs.ReadMetadataItems(srcFileName, 1); 
         } 
         catch (RasterException ex) 
         { 
            Debug.WriteLine(ex.Message); 
         } 
 
         Debug.WriteLine("Items count {0}", metadata.Count); 
         foreach (var item in metadata) 
         { 
            //Key Ex: RasterCodecs.FileMetadataKeyAuthor; 
            Debug.WriteLine("{0}: {1}", item.Key, item.Value); 
         } 
      } 
   } 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images"; 
} 
Requirements

Target Platforms

Help Version 22.0.2023.5.5
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Codecs Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.