exportImage method

  1. @override
Future<File> exportImage(
  1. String srcPath,
  2. CropRect crop,
  3. ImageEncodeSettings settings
)
override

Decodes srcPath with settings' size cap applied at decode time, crops it to crop, re-encodes it, and returns the written file.

The caller owns the returned file.

Throws TransformException on any failure.

Implementation

@override
Future<File> exportImage(
  String srcPath,
  CropRect crop,
  ImageEncodeSettings settings,
) async {
  imageExports.add(
    FakeImageExport(srcPath: srcPath, crop: crop, settings: settings),
  );
  await _settle();
  return _write('img_${_counter++}.${settings.format.fileExtension}');
}