initializeImageMagick function

void initializeImageMagick()

Initializes the necessary resources used with the plugin. This must be called before any use of the plugin.

If this plugin is being used within a Flutter app, this method will be automatically called on boot. Otherwise, you need to call this method before any usage of the plugin.

Note that this method will throw an exception if initializing the environment fails for any reason. In that case, you should not use the plugin before proper initialization.

Implementation

void initializeImageMagick() {
  _magickWandGenesis();
  int initDartApiResult =
      _pluginBindings.initDartAPI(NativeApi.initializeApiDLData);
  if (initDartApiResult != 0) {
    throw Exception('Failed to initialize Dart_API_DL');
  }
}