ImageGear for Java
File Format Support Initialization

ImageGear for Java requires that support for reading, writing, and processing some file formats is explicitly initialized at application startup. This is not true of all file formats supported by ImageGear for Java, only file formats implemented in the JARs listed in the following table require explicit initialization. All file formats implemented in the JARs will be initialized when calling the format initialization method listed in the table.

JAR File File Format Initialization Method
imagegear2.formats.advanced.jar  ImGearAdvancedFormats.Initialize Method
imagegear2.formats.common.jar  ImGearCommonFormats.Initialize Method
imagegear2.formats.simplifiedmetadata.jar ImGearSimplifiedMetadata.Initialize Method

Some file formats require both initialization and termination.

The order in which file format support is initialized is important, because it defines format detection priority.

Advanced formats should usually be initialized last, to allow for faster detection of Common formats.

The following initialization order is recommended:

Java Example
Copy Code
ImGearCommonFormats.Initialize();
ImGearAdvancedFormats.Initialize();

CUT format (supported in ImageGear2.Formats.Advanced JAR) 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, but can be enabled through the IImGearFormat.setDetectionEnabled method.

The order in which simplified metadata formats support is initialized in relation to other format support is not important.

Support for detection of JPEG2000, JPEG2000 Extensions, and Motion JPEG2000 can be added. The order in which these formats are added to the format filter list is important.

Support for detection of DICOM images can be added with the following lines of code. The order in which this format is added to the format filter list is important.

Example
Copy Code
// Adds support for DICOM files.
try
{
        ImGearFileFormats.getFilters().Insert(0, ImGearDICOM.CreateDICOMFormat());
}
catch(ImGearException ex)
{
        // dicom is not licensed. 
        // Continue running, the sample can run without dicom
}

 

 


©2016. Accusoft Corporation. All Rights Reserved.

Send Feedback