initMultimedia function

Future<void> initMultimedia({
  1. bool ffi = true,
  2. bool initMagick = true,
  3. bool testConversion = false,
  4. File? overrideLibrary,
})

Implementation

Future<void> initMultimedia(
    {bool ffi = true,
    bool initMagick = true,
    bool testConversion = false,
    File? overrideLibrary}) async {
  if (_initialized) {
    return;
  }

  _initialized = true;

  if (!ffi) {
    multimediaFFIMode = false;
    return;
  }

  try {
    _load("image_magick_ffi", overrideLibrary);

    if (initMagick) {
      initializeImageMagick();
    }

    if (testConversion) {
      await _testSupportedFormats();
    }
  } catch (e, es) {
    print("Failed to initialize ImageMagick: $e");
    print(es);
  }
}