User Guide > Concepts > Upgrading from v16 or Earlier > Initialize Assemblies |
The following ImageGear assemblies require explicit initialization at application startup:
The following ImageGear assemblies require both initialization and termination:
Assembly | Initialization and Termination Methods |
ImageGear22.Formats.Pdf.dll | ImGearPDF.Initialize Method ImGearPDF.Terminate Method |
The order in which format filter assemblies are initialized is important, because it defines format detection priority. |
CameraRaw formats should be initialized before Common formats, because many camera raw formats use custom versions of TIFF. If the application initializes Common formats before Camera Raw formats, ImageGear can incorrectly detect camera raw files as TIFF. Advanced formats will usually be initialized last, to allow for faster detection of Camera Raw and Common formats.
The following initialization order is recommended:
C# |
Copy Code |
---|---|
ImGearCameraRawFormats.Initialize(); ImGearCommonFormats.Initialize(); ImGearAdvancedFormats.Initialize(); |
CUT format (supported in ImageGear22.Formats.Advanced assembly) doesn't have a specific signature in the file's header, which makes its detection less reliable. Detection of this format in ImageGear is disabled by default.
Headerless Camera Raw format (supported in ImageGear22.Formats.CameraRaw assembly) doesn't have a file header, which makes its detection less reliable. Detection of this format in ImageGear is disabled by default.
If you enable detection of these formats, it is recommended that you move them to the end of the global formats list, as follows:
C# |
Copy Code |
---|---|
IImGearFormat headerlessRawFormat = ImGearFileFormats.Filters.Get(ImGearFormats.HeaderlessRaw); ImGearFileFormats.Filters.Remove(ImGearFormats.HeaderlessRaw); ImGearFileFormats.Filters.Add(headerlessRawFormat); |
The PDF initialize method does not add PDF and PostScript formats to the global format filter list, so the order in which ImageGear22.Formats.Pdf assembly is initialized, in relation to other assemblies, is not important. PDF and PostScript formats should be added explicitly by calling:
C# |
Copy Code |
---|---|
ImGearFileFormats.Filters.Insert(0, ImGearPDF.CreatePDFFormat()); ImGearFileFormats.Filters.Insert(0, ImGearPDF.CreatePSFormat()); |
The order in which ImageGear22.Formats.SimplifiedMetadata assembly is initialized in relation to other assemblies is not important.
Office formats (supported in ImageGear22.Formats.Office assembly) and XPS format (supported in ImageGear22.Wpf assembly) have similar signatures in the file's header. To ensure proper detection, Office formats should be initialized before XPS.
C# |
Copy Code |
---|---|
ImGearFileFormats.Filters.Add(ImGearOffice.CreateWordFormat()); ImGearFileFormats.Filters.Add(ImGearXPS.CreateXPSFormat()); |