Search in sources :

Example 1 with Kdu_message_formatter

use of kdu_jni.Kdu_message_formatter in project imageio-ext by geosolutions-it.

the class KakaduUtilities method initializeKakaduMessagesManagement.

/**
 * Initializing kakadu messages as stated in the KduRender.java example
 */
public static void initializeKakaduMessagesManagement() {
    try {
        // ////
        // Customize error and warning services
        // ////
        // Non-throwing message printer
        Kdu_sysout_message sysout = new Kdu_sysout_message(false);
        // Exception-throwing message printer
        Kdu_sysout_message syserr = new Kdu_sysout_message(true);
        // /////
        // Initialize formatted message printer
        // ////
        // Non-throwing printer
        Kdu_message_formatter pretty_sysout = new Kdu_message_formatter(sysout);
        // Throwing printer
        Kdu_message_formatter pretty_syserr = new Kdu_message_formatter(syserr);
        Kdu_global.Kdu_customize_warnings(pretty_sysout);
        Kdu_global.Kdu_customize_errors(pretty_syserr);
    } catch (KduException e) {
        throw new RuntimeException("Error caused by a Kakadu exception during creation of key objects! ", e);
    }
}
Also used : KduException(kdu_jni.KduException) Kdu_message_formatter(kdu_jni.Kdu_message_formatter)

Aggregations

KduException (kdu_jni.KduException)1 Kdu_message_formatter (kdu_jni.Kdu_message_formatter)1