←Select platform

IgnoreCodecs Method

Summary
Specifies which file codecs LEADTOOLS should NEVER load, even if present.
Syntax
C#
C++/CLI
Java
Python
public void IgnoreCodecs( 
   string codecs 
) 
public void ignoreCodecs(String codecs) 
public: 
void IgnoreCodecs(  
   String^ codecs 
)  
def IgnoreCodecs(self,codecs): 

Parameters

codecs
A String containing which codecs should be ignored and therefore not loaded. Has the same format as in PreloadCodecs.

Remarks

Use this method if you never want to load a particular file codec(s). This is useful for instance if you never load AVI files and you want to ignore the AVI codec since this codec on its own loads all the DLLs required for Video for Windows (there are about 10 of them).

The files specified in PreloadCodecs take priority over the files specified in IgnoreCodecs. This means that if the codec is present in  codecs for both methods, then the codec will be loaded and will not be ignored.

Before calling this method, you can get the default ignore codecs list using IgnoreCodecsList.

Example
C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing; 
using Leadtools.ImageProcessing.Color; 
using Leadtools.Svg; 
 
 
public void PreloadCodecsExample() 
{ 
   RasterCodecs codecs = new RasterCodecs(); 
 
   string srcFileName1 = Path.Combine(LEAD_VARS.ImagesDir, "Image1.j2k"); 
   string srcFileName2 = Path.Combine(LEAD_VARS.ImagesDir, "Image1.cmp"); 
 
   // display the original values before changing them 
   Debug.WriteLine("PreloadCodecList - {0}", codecs.PreloadCodecsList); 
   Debug.WriteLine("FixedPreloadCodecs - {0}", codecs.FixedPreloadCodecs); 
   Debug.WriteLine("CachedPreloadCodecs - {0}", codecs.CachedPreloadCodecs); 
   Debug.WriteLine("IgnoreCodecList - {0}", codecs.IgnoreCodecsList); 
 
   // preload only the j2k filter and ignore the cmp filter 
   codecs.PreloadCodecs(1, 1, "j2k"); 
   codecs.IgnoreCodecs("cmp"); 
 
   // try to get info on a j2k image 
   CodecsImageInfo info = codecs.GetInformation(srcFileName1, false); 
   Debug.WriteLine("j2k - Width: {0}, Height {1}", info.Width, info.Height); 
 
   // try to get info on a cmp image 
   try 
   { 
      info = codecs.GetInformation(srcFileName2, false); 
   } 
   catch 
   { 
      Debug.WriteLine("GetInformation for cmp failed - sample success!"); 
   } 
 
   // Clean up 
   codecs.Dispose(); 
} 
 
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.